PacktLib: Learning jQuery - Fourth Edition

Learning jQuery Fourth Edition

Credits

Foreword

About the Authors

About the Reviewers

www.PacktPub.com

Preface

Getting Started

What jQuery does

Why jQuery works well

Making our first jQuery-powered web page

Plain JavaScript versus jQuery

Using development tools

Summary

Selecting Elements

Understanding the DOM

Using the $() function

CSS selectors

Attribute selectors

Custom selectors

DOM traversal methods

Accessing DOM elements

Summary

Exercises

Handling Events

Performing tasks on page load

Handling simple events

Event propagation

Altering the journey – the event object

Removing an event handler

Simulating user interaction

Summary

Exercises

Styling and Animating

Modifying CSS with inline properties

Hiding and showing elements

Effects and duration

Creating custom animations

Simultaneous versus queued effects

Summary

Exercises

Manipulating the DOM

Manipulating attributes and properties

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

Exploring additional options

Summary

Exercises

Using Plugins

Finding plugins and help

Using a plugin

Other types of plugins

The jQuery UI plugin library

The jQuery Mobile plugin library

Summary

Exercises

Developing Plugins

Using the dollar ($) alias in plugins

Adding new global functions

Adding jQuery object methods

Providing flexible method parameters

Creating plugins with 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

Revisiting events

Event delegation

Defining custom events

Throttling events

Extending events

Summary

Further reading

Exercises

Advanced Effects

Animation revisited

Observing and interrupting animations

Using global effect properties

Multiproperty easing

Using deferred objects

Taking fine-grained control of animations

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

Revisiting attribute manipulation

Summary

Exercises

Advanced Ajax

Implementing progressive enhancement with Ajax

Handling Ajax errors

Using 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