First JQuery Attempt


I have bought the Sitepoint book, JQuery Novice to Ninja and have decided to try out the code on my own website but it won’t work.

What am I doing wrong?

It should in theory make the text automatically increase in size when the page is opened but it doesn’t work

I know it is something dumb but it is my first attempt.


Hi James,

The first thing I noticed when I visited the site is that jQuery is not being loaded (check your browser console and you’ll see the 404 not found error).


The site is loaded in my browser ok though? Just not the jquery actions???

Sorry if I am not understanding but am a total beginner to JQuery.

You’ve got a link in your page to the jQuery library:

<script src="../../lib/jquery-1.7.1.min.js" type="text/javascript" charset="utf-8"></script>

but the browser is saying that it can’t find the file, so either the location is wrong or the file is missing. The very next line in the console is an error message complaining that the jQuery variable ($) isn’t defined (because the library isn’t loaded) and that’s why your font changing script isn’t working.

That is what I copied from the downloads for the book in question.

It seems to work fine on the examples the book gives but not the live website.

Should the link be something different?

The best option is to use one of the commonly used jQuery repositories to increase the likelihood that your visitors already have a cached copy.

For example - Google. See for a list of the addresses to use for their hosted libraries - there are two versions of JQuery in the list.