SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Mar 2007
    Posts
    182
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Firebug error: $ is not defined - jQuery

    I have a basic html page

    Code HTML4Strict:
    <!DOCTYPE html>
    <html lang="en">
    <head>
    	<title>Document</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <script src="http://code.jquery.com/jquery-1.6.2.min.js"></script>
     
        <script>
            $("document").ready(function() {
                $("p").css("border", "3px solid red"); 
            });
        </script>
     
        <style>
            .a { color: Navy; }
            .b { color: Maroon; }    
        </style>
    </head>
    <body>
     
    	<ul id="list1">
    		<li class="a">item 1</li>
    		<li class="a">item 2</li>
    		<li class="b">item 3</li>
    		<li class="b">item 4</li>
    	</ul>
        <p class="a">This is paragraph 1</p>
        <p>This is paragraph 2</p>
        <p class="b">This is paragraph 3</p>
        <p>This is paragraph 4</p>
     
    </body>
    </html>

    I'm downloading jQuery and specifying it using the src attribute on the scropt tag from http://code.jquery.com/jquery-1.6.2.min.js and i'm getting that error.

    I've tried downloading jQuery and saving it locally and that works. However if i use the CDN it's giving me that error on firebug. I have no idea why..

    Here's a screenshot

    Thanks in advance
    Jaysone

  2. #2
    Under Construction silver trophybronze trophy AussieJohn's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    776
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Might be worth checking in the Firebug "Net" tab and check that the file is actually being loaded in. Tested this locally both from a webserver and as a file and it seemed to work fine.
    var details = {
    . . web: "afterlight.com.au",
    . . photos: "jvdl.id.au",
    . . psa: "usethelatestversion.com"
    }

  3. #3
    SitePoint Zealot
    Join Date
    Mar 2007
    Posts
    182
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That solved it! Thank you so much John
    Jaysone


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •