About the Authors |
|
xv | |
About the Technical Reviewer |
|
xvii | |
Acknowledgments |
|
xix | |
Introduction |
|
xxi | |
Chapter 1 Evolution of jQuery |
|
1 | (18) |
|
Traditional JavaScript Basics |
|
|
1 | (7) |
|
|
1 | (2) |
|
|
3 | (5) |
|
|
8 | (4) |
|
Challenges Pertaining to the Window Object |
|
|
9 | (1) |
|
Challenges Pertaining to the Document Object |
|
|
10 | (1) |
|
Challenges Related to the Globals |
|
|
11 | (1) |
|
|
12 | (1) |
|
Who Was the Revolutionary? |
|
|
13 | (1) |
|
|
14 | (4) |
|
|
14 | (1) |
|
|
15 | (1) |
|
|
16 | (1) |
|
|
16 | (2) |
|
|
18 | (1) |
|
|
18 | (1) |
Chapter 2 Getting Started with jQuery |
|
19 | (20) |
|
Document Object Model (DOM) |
|
|
19 | (2) |
|
Downloading and Setting Up jQuery |
|
|
21 | (2) |
|
Downloading from the Official Web Site |
|
|
21 | (2) |
|
Including jQuery from a CDN |
|
|
23 | (1) |
|
|
23 | (1) |
|
|
23 | (8) |
|
|
23 | (1) |
|
|
24 | (1) |
|
jQuery noConflict() Method |
|
|
25 | (2) |
|
|
27 | (4) |
|
|
31 | (7) |
|
|
31 | (3) |
|
|
34 | (1) |
|
Preloading Images with jQuery |
|
|
35 | (1) |
|
|
36 | (2) |
|
|
38 | (1) |
Chapter 3 Traversing DOM with jQuery |
|
39 | (36) |
|
Selecting Elements with CSS Selectors |
|
|
39 | (6) |
|
|
40 | (1) |
|
|
40 | (1) |
|
|
40 | (1) |
|
|
41 | (1) |
|
|
42 | (1) |
|
|
43 | (1) |
|
Relationship-Based Selectors |
|
|
44 | (1) |
|
|
45 | (3) |
|
|
46 | (1) |
|
|
46 | (1) |
|
|
46 | (1) |
|
|
47 | (1) |
|
|
47 | (1) |
|
|
47 | (1) |
|
|
47 | (1) |
|
Traversing DOM with jQuery Traversal Methods |
|
|
48 | (12) |
|
|
49 | (1) |
|
jQuery Methods for DOM Traversal |
|
|
50 | (10) |
|
Caching Selector and Chaining Methods |
|
|
60 | (4) |
|
|
60 | (3) |
|
|
63 | (1) |
|
|
64 | (9) |
|
|
65 | (1) |
|
|
66 | (3) |
|
|
69 | (1) |
|
|
69 | (1) |
|
|
70 | (1) |
|
|
71 | (1) |
|
|
72 | (1) |
|
|
73 | (2) |
Chapter 4 DOM Manipulation with jQuery |
|
75 | (24) |
|
Editing Appearance with jQuery CSS Methods |
|
|
75 | (5) |
|
|
76 | (1) |
|
|
76 | (3) |
|
Setting Multiple CSS Properties |
|
|
79 | (1) |
|
Editing/Changing an Element's Attributes, Contents, and Position |
|
|
80 | (5) |
|
|
80 | (2) |
|
|
82 | (3) |
|
Creating and Inserting New DOM Elements |
|
|
85 | (6) |
|
.append() vs. .appendTo() |
|
|
86 | (1) |
|
Inserting New Elements in Specific Locations |
|
|
87 | (1) |
|
Putting the Methods to Work |
|
|
87 | (4) |
|
Removing and Cloning DOM Elements |
|
|
91 | (4) |
|
|
95 | (3) |
|
jQuery width() and height() Methods |
|
|
96 | (1) |
|
jQuery innerWidth() and innerHeight() Methods |
|
|
96 | (1) |
|
jQuery .outerWidth() and .outerHeight() Methods |
|
|
97 | (1) |
|
|
98 | (1) |
Chapter 5 Events in jQuery |
|
99 | (30) |
|
|
99 | (2) |
|
|
101 | (3) |
|
Event Listeners and Event Handlers |
|
|
104 | (9) |
|
The Event() Method in jQuery |
|
|
113 | (9) |
|
|
117 | (4) |
|
|
121 | (1) |
|
Events Propagation and Events Bubbling |
|
|
122 | (3) |
|
The Event Capturing and Event Bubbling Models |
|
|
123 | (1) |
|
|
123 | (2) |
|
|
125 | (2) |
|
|
127 | (2) |
Chapter 6 Real World Events in jQuery |
|
129 | (22) |
|
Common Gotchas in Event Handling |
|
|
129 | (4) |
|
Handling Dynamic Elements |
|
|
129 | (2) |
|
Handling jQuery Animation Buildup |
|
|
131 | (2) |
|
Preventing Event Propagation and Bubbling |
|
|
133 | (1) |
|
|
134 | (2) |
|
How Handling Works in a jQuery Event Queue |
|
|
135 | (1) |
|
The jQuery queue() Method |
|
|
135 | (1) |
|
Building a jQuery UI Accordion |
|
|
136 | (5) |
|
Using the jQuery UI Accordion |
|
|
137 | (2) |
|
|
139 | (2) |
|
|
141 | (8) |
|
Using the Validate Plug-in |
|
|
142 | (2) |
|
Validating Form Elements Using Customized jQuery |
|
|
144 | (5) |
|
|
149 | (2) |
Chapter 7 Animation in jQuery |
|
151 | (44) |
|
|
151 | (3) |
|
|
154 | (3) |
|
|
157 | (11) |
|
Using the fadeOut() Method |
|
|
158 | (2) |
|
Using the fadeln() Method |
|
|
160 | (4) |
|
Using the fadeTo() Method |
|
|
164 | (2) |
|
Using the fadeToggle() Method |
|
|
166 | (2) |
|
|
168 | (9) |
|
Using the slideUp() Method |
|
|
168 | (3) |
|
Using the slideDown() Method |
|
|
171 | (4) |
|
Using the slideToggle() Method |
|
|
175 | (2) |
|
|
177 | (2) |
|
Creating a Basic Light Box |
|
|
179 | (5) |
|
Controlling Animation Behavior |
|
|
184 | (1) |
|
Smoothing Your Animations |
|
|
184 | (1) |
|
Using the fx Object to Control Frame Rate |
|
|
184 | (1) |
|
Turning Off Your Animation |
|
|
185 | (1) |
|
Creating a Basic Image Slider |
|
|
185 | (8) |
|
|
193 | (2) |
Chapter 8 Ajax with jQuery |
|
195 | (16) |
|
|
195 | (2) |
|
|
195 | (1) |
|
The Technologies That Make Up Ajax |
|
|
196 | (1) |
|
|
197 | (5) |
|
The Nuts and Bolts of Ajax in JavaScript |
|
|
197 | (1) |
|
|
198 | (4) |
|
|
202 | (5) |
|
|
203 | (1) |
|
Parsing JSON with JavaScript |
|
|
204 | (2) |
|
Using the jQuery Alternative to JavaScript |
|
|
206 | (1) |
|
Ajax and JSON Usage Example |
|
|
207 | (3) |
|
|
210 | (1) |
Chapter 9 Creating Plug-ins with jQuery |
|
211 | (18) |
|
|
211 | (2) |
|
|
213 | (2) |
|
|
213 | (1) |
|
|
214 | (1) |
|
|
214 | (1) |
|
Plug-in Writing Guidelines |
|
|
215 | (2) |
|
Do You Really Need the Plug-in? |
|
|
215 | (1) |
|
Reuse What Already Exists |
|
|
216 | (1) |
|
Preserve the Reference to jQuery |
|
|
216 | (1) |
|
Do Not Unnecessarily Modify Objects |
|
|
216 | (1) |
|
|
217 | (1) |
|
Creating a Form Validation Plug-in |
|
|
217 | (4) |
|
Creating an Accordion Plug-in |
|
|
221 | (6) |
|
|
227 | (2) |
Chapter 10 Integrating Plug-ins with jQuery |
|
229 | (16) |
|
|
229 | (3) |
|
|
229 | (1) |
|
The NPM Open Source Package Repository |
|
|
230 | (1) |
|
|
231 | (1) |
|
|
232 | (3) |
|
|
233 | (1) |
|
Do a Test Run on Some Simple Elements |
|
|
233 | (1) |
|
Include the Plug-in File in the script Tag |
|
|
233 | (1) |
|
The Dilemma-in the Head or at the End of the Body |
|
|
233 | (1) |
|
|
234 | (1) |
|
|
235 | (2) |
|
Minifying Code for Distribution |
|
|
237 | (6) |
|
Compression vs. Minification |
|
|
238 | (1) |
|
What Does Minified Code Look Like? |
|
|
239 | (2) |
|
There Is More: Uglification and Beautification |
|
|
241 | (2) |
|
|
243 | (2) |
Chapter 11 Using jQuery Frameworks |
|
245 | (20) |
|
JavaScript and jQuery Frameworks |
|
|
245 | (7) |
|
|
245 | (4) |
|
|
249 | (3) |
|
|
252 | (1) |
|
|
253 | (6) |
|
Drag and Drop Using jQuery UI |
|
|
253 | (3) |
|
|
256 | (2) |
|
|
258 | (1) |
|
|
259 | (4) |
|
Some Cool Features of jQuery Mobile |
|
|
259 | (2) |
|
|
261 | (1) |
|
|
262 | (1) |
|
|
263 | (2) |
Chapter 12 Testing jQuery with QUnit |
|
265 | (24) |
|
QUnit as a JavaScript Framework |
|
|
265 | (1) |
|
Introduction to Unit Testing |
|
|
266 | (3) |
|
The Need for Unit Testing |
|
|
267 | (1) |
|
|
268 | (1) |
|
Getting Started with QUnit |
|
|
269 | (10) |
|
|
269 | (1) |
|
|
270 | (1) |
|
Writing the First Test Case |
|
|
270 | (3) |
|
Commonly Used QUnit Methods |
|
|
273 | (6) |
|
|
279 | (3) |
|
|
282 | (6) |
|
|
283 | (1) |
|
Moving Ahead in Refactoring |
|
|
284 | (3) |
|
Writing Another Test Case on the Refactored Code |
|
|
287 | (1) |
|
|
288 | (1) |
Index |
|
289 | |