Just several TIPS on Adding jQuery to a Page
Here are a few things to keep in mind:
- The link to the jQuery file must precede any programming that relies on jQuery. In other words, don’t put any other script tags before the <script> tag that loads jQuery.
// your programming goes here
}); // end ready
Putting a comment at the end of the function makes it easy to identify the end of the program.
As you’ll see later, jQuery often requires lots of little collections of this brace, parenthesis, and semicolon trio. By adding a comment after them, it’ll be much easier to identify which group of punctuation belongs to which part of your program.