-
Chapter 1 jQuery Basics
-
Introduction
-
Including the jQuery Library Code in an HTML Page
-
Executing jQuery/JavaScript Coded After the DOM Has Loaded but Before Complete Page Load
-
Selecting DOM Elements Using Selectors and the jQuery Function
-
Selecting DOM Elements Within a Specified Context
-
Filtering a Wrapper Set of DOM Elements
-
Finding Descendant Elements Within the Currently Selected Wrapper Set
-
Returning to the Prior Selection Before a Destructive Change
-
Including the Previous Selection with the Current Selection
-
Traversing the DOM Based on Your Current Context to Acquire a New Set of DOM Elements
-
Creating, Operating on, and Inserting DOM Elements
-
Removing DOM Elements
-
Replacing DOM Elements
-
Cloning DOM Elements
-
Getting, Setting, and Removing DOM Element Attributes
-
Getting and Setting HTML Content
-
Getting and Setting Text Content
-
Using the $ Alias Without Creating Global Conflicts
-
-
Chapter 2 Selecting Elements with jQuery
-
Introduction
-
Selecting Child Elements Only
-
Selecting Specific Siblings
-
Selecting Elements by Index Order
-
Selecting Elements That Are Currently Animating
-
Selecting Elements Based on What They Contain
-
Selecting Elements by What They Don’t Match
-
Selecting Elements Based on Their Visibility
-
Selecting Elements Based on Attributes
-
Selecting Form Elements by Type
-
Selecting an Element with Specific Characteristics
-
Using the Context Parameter
-
Creating a Custom Filter Selector
-
-
Chapter 3 Beyond the Basics
-
Introduction
-
Looping Through a Set of Selected Results
-
Reducing the Selection Set to a Specified Item
-
Convert a Selected jQuery Object into a Raw DOM Object
-
Getting the Index of an Item in a Selection
-
Making a Unique Array of Values from an Existing Array
-
Performing an Action on a Subset of the Selected Set
-
Configuring jQuery Not to Conflict with Other Libraries
-
Adding Functionality with Plugins
-
Determining the Exact Query That Was Used
-
-
Chapter 4 jQuery Utilities
-
Introduction
-
Detecting Features with jQuery.support
-
Iterating Over Arrays and Objects with jQuery.each
-
Filtering Arrays with jQuery.grep
-
Iterating and Modifying Array Entries with jQuery.map
-
Combining Two Arrays with jQuery.merge
-
Filtering Out Duplicate Array Entries with jQuery.unique
-
Testing Callback Functions with jQuery.isFunction
-
Removing Whitespace from Strings or Form Values with jQuery.trim
-
Attaching Objects and Data to DOM with jQuery.data
-
Extending Objects with jQuery.extend
-
-
Chapter 5 Faster, Simpler, More Fun
-
Introduction
-
That’s Not jQuery, It’s JavaScript!
-
What’s Wrong with $(this)?
-
Removing Redundant Repetition
-
Formatting Your jQuery Chains
-
Borrowing Code from Other Libraries
-
Writing a Custom Iterator
-
Toggling an Attribute
-
Finding the Bottlenecks
-
Caching Your jQuery Objects
-
Writing Faster Selectors
-
Loading Tables Faster
-
Coding Bare-Metal Loops
-
Reducing Name Lookups
-
Updating the DOM Faster with .innerHTML
-
Debugging? Break Those Chains
-
Is It a jQuery Bug?
-
Tracing into jQuery
-
Making Fewer Server Requests
-
Writing Unobtrusive JavaScript
-
Using jQuery for Progressive Enhancement
-
Making Your Pages Accessible
-
-
Chapter 6 Dimensions
-
Introduction
-
Finding the Dimensions of the Window and Document
-
Finding the Dimensions of an Element
-
Finding the Offset of an Element
-
Scrolling an Element into View
-
Determining Whether an Element Is Within the Viewport
-
Centering an Element Within the Viewport
-
Absolutely Positioning an Element at Its Current Position
-
Positioning an Element Relative to Another Element
-
Switching Stylesheets Based on Browser Width
-
-
Chapter 7 Effects
-
Introduction
-
Sliding and Fading Elements in and out of View
-
Making Elements Visible by Sliding Them Up
-
Creating a Horizontal Accordion
-
Simultaneously Sliding and Fading Elements
-
Applying Sequential Effects
-
Determining Whether Elements Are Currently Being Animated
-
Stopping and Resetting Animations
-
Using Custom Easing Methods for Effects
-
Disabling All Effects
-
Using jQuery UI for Advanced Effects
-
-
Chapter 8 Events
-
Introduction
-
Attaching a Handler to Many Events
-
Reusing a Handler Function with Different Data
-
Removing a Whole Set of Event Handlers
-
Triggering Specific Event Handlers
-
Passing Dynamic Data to Event Handlers
-
Accessing an Element ASAP (Before document.ready)
-
Stopping the Handler Execution Loop
-
Getting the Correct Element When Using event.target
-
Avoid Multiple hover() Animations in Parallel
-
Making Event Handlers Work for Newly Added Elements
-
-
Chapter 9 Advanced Events
-
Introduction
-
Getting jQuery to Work When Loaded Dynamically
-
Speeding Up Global Event Triggering
-
Creating Your Own Events
-
Letting Event Handlers Provide Needed Data
-
Creating Event-Driven Plugins
-
Getting Notified When jQuery Methods Are Called
-
Using Objects’ Methods as Event Listeners
-
-
Chapter 10 HTML Form Enhancements from Scratch
-
Introduction
-
Focusing a Text Input on Page Load
-
Disabling and Enabling Form Elements
-
Selecting Radio Buttons Automatically
-
(De)selecting All Checkboxes Using Dedicated Links
-
(De)selecting All Checkboxes Using a Single Toggle
-
Adding and Removing Select Options
-
Autotabbing Based on Character Count
-
Displaying Remaining Character Count
-
Constraining Text Input to Specific Characters
-
Submitting a Form Using Ajax
-
Validating Forms
-
-
Chapter 11 HTML Form Enhancements with Plugins
-
Introduction
-
Validating Forms
-
Creating Masked Input Fields
-
Autocompleting Text Fields
-
Selecting a Range of Values
-
Entering a Range-Constrained Value
-
Uploading Files in the Background
-
Limiting the Length of Text Inputs
-
Displaying Labels Above Input Fields
-
Growing an Input with Its Content
-
Choosing a Date
-
-
Chapter 12 jQuery Plugins
-
Introduction
-
Where Do You Find jQuery Plugins?
-
When Should You Write a jQuery Plugin?
-
Writing Your First jQuery Plugin
-
Passing Options into Your Plugin
-
Using the $ Shortcut in Your Plugin
-
Including Private Functions in Your Plugin
-
Supporting the Metadata Plugin
-
Adding a Static Function to Your Plugin
-
Unit Testing Your Plugin with QUnit
-
-
Chapter 13 Interface Components from Scratch
-
Introduction
-
Creating Custom Tool Tips
-
Navigating with a File-Tree Expander
-
Expanding an Accordion
-
Tabbing Through a Document
-
Displaying a Simple Modal Window
-
Building Drop-Down Menus
-
Cross-Fading Rotating Images
-
Sliding Panels
-
-
Chapter 14 User Interfaces with jQuery UI
-
Introduction
-
Including the Entire jQuery UI Suite
-
Including an Individual jQuery UI Plugin or Two
-
Initializing a jQuery UI Plugin with Default Options
-
Initializing a jQuery UI Plugin with Custom Options
-
Creating Your Very Own jQuery UI Plugin Defaults
-
Getting and Setting jQuery UI Plugin Options
-
Calling jQuery UI Plugin Methods
-
Handling jQuery UI Plugin Events
-
Destroying a jQuery UI Plugin
-
Creating a jQuery UI Music Player
-
-
Chapter 15 jQuery UI Theming
-
Introduction
-
Styling jQuery UI Widgets with ThemeRoller
-
Overriding jQuery UI Layout and Theme Styles
-
Applying a Theme to Non-jQuery UI Components
-
Referencing Multiple Themes on a Single Page
-
Appendix: Additional CSS Resources
-
-
Chapter 16 jQuery, Ajax, Data Formats: HTML, XML, JSON, JSONP
-
Introduction
-
jQuery and Ajax
-
Using Ajax on Your Whole Site
-
Using Simple Ajax with User Feedback
-
Using Ajax Shortcuts and Data Types
-
Using HTML Fragments and jQuery
-
Converting XML to DOM
-
Creating JSON
-
Parsing JSON
-
Using jQuery and JSONP
-
-
Chapter 17 Using jQuery in Large Projects
-
Introduction
-
Using Client-Side Storage
-
Saving Application State for a Single Session
-
Saving Application State Between Sessions
-
Using a JavaScript Template Engine
-
Queuing Ajax Requests
-
Dealing with Ajax and the Back Button
-
Putting JavaScript at the End of a Page
-
-
Chapter 18 Unit Testing
-
Introduction
-
Automating Unit Testing
-
Asserting Results
-
Testing Synchronous Callbacks
-
Testing Asynchronous Callbacks
-
Testing User Actions
-
Keeping Tests Atomic
-
Grouping Tests
-
Selecting Tests to Run
-
-
Colophon
- Title:
- jQuery Cookbook
- Edited By:
- Cody Lindley
- Publisher:
- O'Reilly Media
- Formats:
-
- Ebook
- Safari Books Online
- Print Release:
- November 2009
- Ebook Release:
- November 2009
- Pages:
- 480
- Print ISBN:
- 978-0-596-15977-1
- | ISBN 10:
- 0-596-15977-3
- Ebook ISBN:
- 978-0-596-80811-2
- | ISBN 10:
- 0-596-80811-9
The animal on the cover of the jQuery Cookbook is an ermine (Mustela erminea), also known as a stoat. "Ermine" sometimes refers to the animal's white winter fur, and "stoat" to the brown fur it has during the rest of the year. It belongs to the weasel family, which includes martens, ferrets, minks, otters, and polecats, though it is distinguished from these other members by its black-tipped tail.
The ermine lives in northern woodland regions of Europe, Asia, and North America. It is mainly nocturnal and makes dens in tree roots, under stones, and in tunnels. A solitary animal, the ermine can travel up to 10 miles in one night searching for food. Its predators include foxes, badgers, cats, and birds of prey.
The ermine's slender body helps it run swiftly, even across snow, as well as climb and swim. Although this shape has advantages, it also causes the ermine to quickly lose heat from its body. Thick fur and a fast metabolism help compensate, and the ermine must eat daily to meet its energy demands. Its diet includes small mammals, birds, fish, and insects. When the ermine spots its prey, it sneaks up on it in a series of leaps, grasps the victim's neck, and kills it with repeated bites.
White ermine fur is highly prized and is used in trimming coats, although demand has dropped in recent years. Typically, several furs are sewn together to form a pattern of black dots on a white field. This pattern was imitated in heraldry-the design of coats of arms-as early as the 12th century, most famously in the arms of Brittany. Ermine fur is also a symbol of royalty or purity, which is perhaps why Elizabeth I of England, "the Virgin Queen," was painted with an ermine by her side.
The cover image is from Riverside Natural History. The cover font is Adobe ITC Garamond. The text font is Linotype Birka; the heading font is Adobe Myriad Condensed; and the code font is LucasFont's TheSansMonoCondensed.
