Skip to content Skip to sidebar Skip to footer

Jquery Dollar Sign Is Undefined

In my quest to get historical information, i tried using the below code. Chrome debugger says that Uncaught ReferenceError: $ is not defined. Can you suggest a fix, i'm really stuc

Solution 1:

Just add a reference to the JQuery source before your script:

<scriptsrc="http://code.jquery.com/jquery.min.js"></script>

Solution 2:

Add this line:

google.load("jquery", "1.7.1");

Just under this one you already have:

google.load('visualization', '1', {'packages':['annotatedtimeline']});

This will load jQuery from the Google jsapi you already use. This is the best solution regarding your code.

Solution 3:

Try adding a jQuery reference:

<head><scripttype='text/javascript'src='http://code.jquery.com/jquery-1.8.3.min.js'></script><scripttype='text/javascript'src='http://www.google.com/jsapi'></script><scripttype='text/javascript'>

OR (but i thinks this wont work because you are calling a jQuery in your loading function, thus first way is probably better)

Add it via the JSAPI Google Loader you're using:

<head><scripttype='text/javascript'src='http://www.google.com/jsapi'></script><scripttype='text/javascript'>
        google.load('visualization', '1', {'packages':['annotatedtimeline']});
        google.load("jquery", "1.8.3"); // note, you can also load jQueryUI this way,

// on another note, not sure how high a version google supports Please see Hosted Libs for more info

Post a Comment for "Jquery Dollar Sign Is Undefined"