No announcement yet.

trying to install and get jQuery to work...

  • 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" "">
    <html xmlns="">
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <meta name="subject" content="" />
    <meta name="Description" content="" />
    <meta name="Keywords" content="" />
    <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="" type="text/javascript"></script>

    <style type="text/css">

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


    <script type="text/javascript">
    $(function() {
    $('a').click(function() {




    <div id="box">

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



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

    <div id="box">

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


    • #3
      Two quick things:
      1)You should link to jQuery like this:
      <script type="text/javascript" src=""></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
      $('a').click(function() {
      return false;
      This makes sure that the link is not activated by the browser.
      Swedish Meatball Pornography






      Latest Topics


      • KitchWitch
        Reply to Redesign of our company's logo
        Hi Watado and welcome to GDF.

        We ask all new members to read very important links here and here. These explain the rules, how the forum runs and a few inside jokes. No, you haven't done...
        Today, 08:01 AM
      • watado
        Redesign of our company's logo
        I redesigned the logo of my company to make it a little bit more moderne and that the lettering looks better besides the smiley.

        So, please vote if Line 1 OR Line 2 looks better...
        Today, 07:51 AM
      • PrintDriver
        Reply to Looking for mentor
        I'm quite aware of the situation in many so-called design programs in various colleges all over the US. We are what, 30 years into the computer era of design, and the last 15 years or so have seen far...
        Today, 06:16 AM
      • WilliamBrown
        Reply to Personal logo feedback
        Show us a final result later, okay?
        Today, 03:21 AM
      • WilliamBrown
        Reply to Web site for a web agency
        Tell us later how did it go, okay? ...
        Today, 03:20 AM

      Incredible Stock
      GDF A division of Mediabistro Holdings Adweek | Mediabistro | Clio | Film Expo Group Contact Us | Terms of Use | Privacy Policy Copyright 2016 Mediabistro Holdings