When you get that error in Firebug, it's almost always because the
jquery.js file has not been included or your reference to it is
pointing to the wrong location. Take a look at "Setting up the HTML
Document" beginning on page 8, especially this part on page 10:
After the stylesheet is referenced, the JavaScript files are
included. It is important
that the script tag for the jQuery library be placed before the tag
for our custom
scripts; otherwise, the jQuery framework will not be available when
our code
attempts to reference it.
If you're still having problems after checking that out, let us know.
--Karl
_________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com
On Oct 4, 2007, at 3:48 PM, crybaby wrote:
I just got the Learning jQuery book from amazon delivered yesterday.
I am trying out the first chapter. When add the alice.js on the html
file and open it into the browser, I get this error in firebug:
$ is no defined
my alice.js file has the following content:
$(document).ready(function() {
$('.poem-stanza').addClass('emphasized');
});
any suggestions to fix it and emphasize is not working as claimed by
the book (no boxes..etc)?