Most chapters in the book conclude with one or more exercises. For some exercises, you’ll be able to work directly in Firebug; for others, you will need to include other scripts after the jQuery script tag as directed in the individual exercises.
In some cases, you will need to consult the jQuery documentation in order to complete an exercise, as we won’t have covered all of the relevant information in the book. This is by design; the jQuery library is large, and learning to find answers in the documentation is an important part of the process.
Here are a few suggestions for tackling these problems:
First, make sure you thoroughly understand the problem you're being asked to solve.
Next, figure out which elements you'll need to access in order to solve the problem, and determine how you'll get those elements. Use Firebug to verify that you're getting the elements you're after.
Finally, figure out what you need to do with the elements to solve the problem. It can be helpful to write comments explaining what you're going to do before you try to write the code to do it.
Do not be afraid to make mistakes! Do not try to make your code
perfect on the first try! Making mistakes and experimenting with solutions
is part of learning the library, and you’ll be a better developer for it.
Examples of solutions for these exercises are located in the
/solutions
directory in the sample code.
Copyright Rebecca Murphey, released under the Creative Commons Attribution-Share Alike 3.0 United States license.