Contents
Chapter 1: Putting jQuery in Context
Understanding jQuery UI and jQuery Mobile
What Is the Structure of This Book?
Part 3: Working with Data and Ajax
What’s New for jQuery Mobile?
Where Can I Get the Example Code?
What Software Do I Need for This Book?
Introducing a Basic HTML Document
Understanding the Anatomy of an HTML Element
Understanding the Document Structure
Understanding the Metadata Elements
Understanding the Content Elements
Understanding the Element Hierarchy
Understanding Parent-Child Relationships
Understanding Ancestor-Descendant Relationships
Understanding Sibling Relationships
Understanding the Document Object Model
Defining an External Style Sheet
Selecting Using the Pseudo-element and Pseudo-class Selectors
Unions and the Negation Selectors
Understanding How Styles Cascade
Tweaking the Order with Important Styles
Tie-Breaking with Specificity and Order Assessments
Using Shorthand Properties and Custom Values
Getting Ready to Use JavaScript
Defining Functions with Parameters
Defining Functions That Return Results
The Equality Operator vs. the Identity Operator
Reading and Modifying the Contents of an Array
Enumerating the Contents of an Array
Using the Built-in Array Methods
Comparing undefined and null Values
Checking for null or undefined
Differentiating Between null and undefined
Understanding the jQuery $ Function
Waiting for the Document Object Model
Using the Alternative Notation
Narrowing the Selection with a Context
Understanding the Selection Result
Modifying Multiple Elements and Chaining Method Calls
Chapter 6: Managing the Element Selection
Reducing the Selection to a Specific Element
Reducing the Selection by Range
Reducing the Selection Based on Descendants
Changing and Then Unwinding the Selection
Navigating Across the Hierarchy
Chapter 7: Manipulating the DOM
Creating Elements Using the $ Function
Creating New Elements by Cloning Existing Elements
Creating Elements Using the DOM API
Inserting Child and Descendant Elements
Inserting the Same Elements in Different Positions
Inserting from a jQuery Object
Inserting Elements Using a Function
Inserting Parent and Ancestor Elements
Wrapping Elements Together in a Single Parent
Wrapping the Content of Elements
Wrapping Elements Using a Function
Inserting Siblings from a jQuery Object
Inserting Siblings Using a Function
Replacing Elements Using a Function
Chapter 8: Manipulating Elements
Working with Attributes and Properties
Setting Attribute Values Dynamically
Adding and Removing Classes Using a Function
Toggling Classes in One Direction
Getting and Setting a Single CSS Value
Getting Multiple CSS Properties
Setting Multiple CSS Properties
Setting Properties Using a Function
Using the Property-Specific CSS Convenience Methods
Setting Element Content Using a Function
Setting Form Element Values Using a Function
Associating Data with Elements
Chapter 9: Working with Events
Registering a Function to Handle Multiple Event Types
Providing Data to the Event Handler Function
Suppressing the Default Action
Removing Event Handler Functions
Limiting DOM Traversal for Live Event Handlers
Manually Invoking Event Handlers
Using the triggerHandler Method
Using the Event Shorthand Methods
Using the Document Event Shorthand Methods
Using the Browser Event Shorthand Methods
Using the Mouse Event Shorthand Methods
Using the Form Event Shorthand Methods
Using the Keyboard Event Shorthand Methods
Chapter 10: Using jQuery Effects
Animating the Visibility of Elements
Using Absolute Target Property Values
Using Relative Target Property Values
Creating and Managing the Effect Queue
Displaying the Items in the Effect Queue
Stopping Effects and Clearing the Queue
Inserting a Delay into the Queue
Inserting Functions into the Queue
Enabling and Disabling Effect Animations
Chapter 11: Refactoring the Example: Part I
Reviewing the Example Document
Adding Additional Flower Products
Dealing with the Submit Button
Implementing the Carousel Event Handler Functions
Totaling the Product Selection
Chapter 12: Using Data Templates
Understanding the Problem That Templates Solve
Setting Up the Template Library
A First Data Templates Example
Enumerating Arrays and Properties
Creating Custom Template Helpers
Creating a Conditional Template Helper
Returning More Complex Content
Receiving Optional Arguments in the Helper Function
Providing Custom Template Properties
Chapter 13: Working with Forms
Recapping the Form-Event Methods
Specifying Validation Messages
Formatting the Validation Error Display
Chapter 14: Using Ajax: Part I
Using the Ajax Shorthand Methods
Performing an Ajax GET Request
Performing an Ajax POST Request
Specifying the Expected Data Type
Avoiding the Most Common Ajax Pitfall
Using the Type-Specific Convenience Methods
Chapter 15: Using Ajax: Part II
Making a Simple Ajax Request with the Low-Level API
Understanding the jqXHR Object
Dealing with Successful Requests
Dealing with Completed Requests
Configuring Requests Before They Are Sent
Specifying Multiple Event Handler Functions
Setting the Context for Events
Configuring the Basic Settings for an Ajax Request
Sending JSON Data to the Server
Using Advanced Configuration Settings
Making the Request Synchronously
Dealing with the Response Status Code
Setting Up and Filtering Ajax Requests
Chapter 16: Refactoring the Example: Part II
Reviewing the Refactored Example
Sourcing the Product Information
Submitting the Form Data Using Ajax
Processing the Server Response
Chapter 17: Setting Up jQuery UI
Creating the jQuery UI Custom Download
Installing jQuery UI for Development
Adding jQuery UI to an HTML Document
Installing jQuery UI for Production
Using jQuery UI via a Content Distribution Network
Chapter 18: Using the Button, Progress Bar, and Slider Widgets
Using jQuery UI Icons in Buttons
Creating Different Types of Button
Using the jQuery UI Progress Bar
Creating an Indeterminate Progress Bar
Using the Progress Bar Methods
Chapter 19: Using the Autocomplete and Accordion Widgets
Creating the Autocomplete Element
Using the Autocomplete Methods
Chapter 20: Using the Tabs Widget
Chapter 21: Using the Datepicker Widget
Performing Basic Configuration
Managing the Appearance of the Datepicker
Getting and Setting the Date Programmatically
Showing and Hiding Pop-up Datepickers Programmatically
Responding to a Month or Year Change
Responding to the Pop-up Closing
Chapter 22: Using the Dialog and Spinner Widgets
Using the jQuery UI Dialog Widget
Using the jQuery UI Spinner Widget
Using the Spinner Widget with the HTML5 Input Element Types
Configuring the Spinner Widget
Chapter 23: Using the Menu and Tooltip Widgets
Using the jQuery UI Menu Widget
Using the jQuery UI Tooltip Widget
Chapter 24: Using the Drag-and-Drop Interactions
Creating the Draggable Interaction
Configuring the Draggable Interaction
Using the Droppable Interaction
Dealing with Overlapping Elements
Configuring the Droppable Interaction
Snapping to the Edges of Elements
Chapter 25: Using the Other Interactions
Using the Sortable Interaction
Configuring the Sortable Interaction
Using the Selectable Interaction
Configuring the Selectable Interaction
Using the Selectable Interaction Methods
Using the Selectable Interaction Events
Using the Resizable Interaction
Configuring the Resizable Interaction
Chapter 26: Refactoring the Example: Part III
Reviewing the Refactored Example
Applying the CSS Framework More Widely
Applying Rounded Corners to the Table
Handling the Place Order Button Click
Chapter 27: Getting Started with jQuery Mobile
Understanding the jQuery Mobile Approach
Understanding Automatic Enhancement
Understanding jQuery Mobile Events
Responding to Device Orientation Changes
Avoiding the Two Cardinal Sins of Mobile Development
Avoiding Unrealistic Simulation and Testing
Using a Mobile Browser Emulator
Chapter 28: Pages, Themes & Layouts
Understanding jQuery Mobile Pages
Adding Headers and Footers to a Page
Using Scripting to Control jQuery Mobile Pages
Loading Pages in the Background
Handling the Page Initialization Event
Responding to Page Transitions
Applying Swatches to Individual Elements
Chapter 29: The Dialog & Popup Widgets
Using the jQuery Mobile Dialog Widget
Using the jQuery Mobile Popup Widget
Chapter 30: Buttons and Collapsible Blocks
Configuring jQuery Mobile Buttons
Configuring jQuery Mobile NavBar
Using the NavBar Methods & Events
Using Collapsible Content Blocks
Creating the Collapsible Block
Configuring jQuery Mobile Collapsible Content Blocks
Using Collapsible Block Methods
Using Collapsible Block Events
Using jQuery Mobile Collapsible Sets (Accordions)
Configuring the Collapsible Set
Using the Collapsible Set Methods
Using the Collapsible Set Events
Chapter 31: Using jQuery Mobile Forms
Configuring the Textinput Widget
Using the Textinput Widget Methods
Using the Textinput Widget Events
Using the Slider and Range Slider Widgets
Configuring the Slider and Range Slider Widgets
Using the Slider and Range Slider Methods
Configuring the SelectMenu Widget
Using the Checkboxradio Widget
Creating and Formatting Radio Buttons
Configuring the Checkboxradio Widget
Using the Checkboxradio Methods
Using the Checkboxradio Events
Chapter 32: Using Lists and Panels
Configuring the Listview Widget
Chapter 33: Refactoring the Example: Part IV
Inserting Products Programmatically
Adding a Button to the Information Page
Implementing the Checkout Process
Chapter 34: Using the jQuery Utility Methods
Queues Revisited: Using General Purpose Queues
Manually Processing Queue Items
Chapter 35: The jQuery UI Effects & CSS Framework
Using the jQuery UI Animations
Using the jQuery UI CSS Framework
Using the Widget Container Classes
Using the Interaction State Classes
Chapter 36: Using Deferred Objects
A First Deferred Objects Example
Understanding Why Deferred Objects Are Useful
Using Outcome-Indifferent Callbacks
Using the Outcomes of Multiple Deferred Objects
Providing Progress Information
3.133.157.142