PacktLib: Learning jQuery, Third Edition

Learning jQuery Third Edition

Credits

Foreword

About the Authors

About the Reviewers

www.PacktPub.com

Preface

Getting Started

What jQuery does

Why jQuery works well

Our first jQuery-powered web page

Plain JavaScript vs. jQuery

Development tools

Summary

Selecting Elements

The Document Object Model

The $() function

CSS selectors

Custom selectors

DOM traversal methods

Accessing DOM elements

Summary

Exercises

Handling Events

Performing tasks on page load

Simple events

Compound events

The journey of an event

Altering the journey: the event object

Removing an event handler

Simulating user interaction

Summary

Exercises

Styling and Animating

Inline CSS modification

Basic hide and show

Effects and speed

Creating custom animations

Simultaneous versus queued effects

Summary

Exercises

Manipulating the DOM

Manipulating attributes

DOM tree manipulation

Copying elements

Content getter and setter methods

DOM manipulation methods in a nutshell

Summary

Exercises

Sending Data with Ajax

Loading data on demand

Choosing a data format

Passing data to the server

Delivering different content for Ajax requests

Keeping an eye on the request

Error handling

Ajax and events

Security limitations

Additional options

Summary

Exercises

Using Plugins

Finding plugins and help

How to use a plugin

The jQuery UI plugin library

Summary

Exercises

Developing Plugins

Use of the $ alias in plugins

Adding new global functions

Adding jQuery object methods

Method parameters

The jQuery UI widget factory

Plugin design recommendations

Summary

Exercises

Advanced Selectors and Traversing

Selecting and traversing revisited

Customizing and optimizing selectors

DOM traversal under the hood

Summary

Exercises

Advanced Events

Events revisited

Event delegation

Custom events

Throttling events

Special events

Summary

Exercises

Advanced Effects

Animation revisited

Observing and interrupting animations

Global effect properties

Multi-property easing

Deferred objects

Summary

Exercises

Advanced DOM Manipulation

Sorting table rows

Moving and inserting elements, revisited

Storing data alongside DOM elements

Using HTML5 custom data attributes

Sorting and building rows with JSON

Advanced attribute manipulation

Summary

Exercises

Advanced Ajax

Progressive enhancement with Ajax

Ajax error handling

The jqXHR object

Throttling Ajax requests

Extending Ajax capabilities

Summary

Exercises

JavaScript Closures

JavaScript Closures

JavaScript Closures

JavaScript Closures

JavaScript Closures

JavaScript Closures

Testing JavaScript with QUnit

Testing JavaScript with QUnit

Testing JavaScript with QUnit

Testing JavaScript with QUnit

Testing JavaScript with QUnit

Testing JavaScript with QUnit

Testing JavaScript with QUnit

Testing JavaScript with QUnit

Quick Reference

Quick Reference

Quick Reference

Quick Reference

Quick Reference

Quick Reference

Quick Reference

Quick Reference

Quick Reference

Index