Announcement Announcement Module
Collapse
No announcement yet.
trying to install and get jQuery to work... Page Title Module
Move Remove Collapse
Search Search Module
Collapse

Advertisement Advertisement Module
Collapse

Featured Images Featured Images Module
Collapse

Mediabistro Creative Sites Mediabistro Creative Sites Module
Collapse
Latest Topics Latest Topics Module
Collapse

  • MichaelWied
    Reply to Company Logo Rebranding Critique
    MichaelWied
    Sorry, but the tags scream "I don't have an original thought" no matter what orientation they're in. I can understand trying to use them if someone is just totally concentrated on the logo and...
    Today, 04:07 AM
  • ISitude
    Reply to What is this product ? please
    ISitude
    Whipped cream.
    Today, 03:17 AM
  • LumLum1013
    Feedback for my personal logo
    LumLum1013
    I'm in the process of a major personal portfolio overhaul, going back to the basics and revisiting my logo and identity.

    Most of my graphic design work is on the corporate side, so definitely
    ...
    Today, 02:59 AM
  • mikeengland
    Reply to Have you met ...me
    mikeengland
    I haven't interned, but I have done a nice chunk of freelancing. Also while viewing other users I checked out the rules. I have applied at a few places, but so far I have had only one interview. It went...
    Today, 01:35 AM
  • Buda
    Reply to Have you met ...me
    Buda
    Hi Mike and welcome to GDF.

    We ask every new member to read the threads posted HERE, particularly this thread to get acquainted with how things work on GDF. They will explain how the...
    Today, 01:23 AM
Advertisement Advertisement Module
Collapse

Sponsors Sponsors Module
Collapse

X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • trying to install and get jQuery to work...

    I want to play around with some jQuery, but I can't get anything to work. I must be missing something somewhere...I posted my test page below. When I click the link it should fade the red box out, but nothing happens. I don't get any errors in Firebug and I know my path to the javascript file is correct. Any ideas?

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <meta name="subject" content="" />
    <meta name="Description" content="" />
    <meta name="Keywords" content="" />
    <title></title>
    <link href="xxx.css" rel="stylesheet" type="text/css" media="screen"/>
    <link rel="icon" href="favicon.ico" type="image/x-icon" />
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
    <script src="http://www.site.com/js/jquery-1.3.2.min.js" type="text/javascript"></script>

    <style type="text/css">

    #box {background-color: red; width: 300px; height: 300px;}

    </style>

    <script type="text/javascript">
    $(function() {
    $('a').click(function() {
    $('#box').fadeOut();
    });
    });

    </script>


    </head>

    <body>

    <div id="box">

    </div>
    <a href="">fade Out</a>

    </body>

    </html>

  • #2
    haha wow, find out the problem....I added a "#" into the link href and it worked...

    <div id="box">

    </div>
    <a href="#">fade Out</a>

    Comment


    • #3
      Two quick things:
      1)You should link to jQuery like this:
      Code:
      <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
      That way it's possible the user will have it cached.

      2) you should add return false to the end of any link function that doesn't activate a link
      Code:
      $('a').click(function() {
      $('#box').fadeOut();
      return false;
      });
      This makes sure that the link is not activated by the browser.
      Swedish Meatball Pornography

      Comment

       
      home | site map | advertising/sponsorships | about us | careers | contact us | help courses | browse jobs | freelancers | events | forums | content | member benefits | reprints & permissions about | terms of use | privacy policy | Copyright © 2014 Mediabistro Inc. Mediabistro Inc. call (212) 389-2000 or email us
      Working...
      X