Contents

   ACKNOWLEDGMENTS

   INTRODUCTION

1 Getting Started with jQuery

   What You Need to Know

       Basic HTML and CSS Knowledge

       Basic Text Editor and Web Browser Knowledge

       Basic JavaScript Knowledge

   What Is jQuery?

       What Can jQuery Do?

       Who Can Use jQuery?

   Why jQuery Is Useful

       Accessible

       Browser Inconsistencies

       Additional Functionality

   Begin Using jQuery

       Obtaining jQuery

       Using a CDN

       Local or CDN: Which Method Should I Use?

   Your First jQuery Script

       Locating the Proper Element

       Waiting for the Document to Be Ready

   Try This 1-1: Add Another Class

   Resources for Help

   Chapter 1 Self Test

2 Selecting Elements in the Document

   The $() Function

   CSS Basics

       Selecting Elements

       Selecting Elements Using IDs and Classes

   Using CSS Selectors

       The All, Element, Class, and ID Selectors

       The Descendant Selector

       The Child Selector

       The First Child, Last Child, and Nth Child Selectors

       The Not Selector

       Attribute Selectors

       The Remaining CSS Selectors

   Try This 2-1: Add Another Class

   Using Extended jQuery Selectors

       The Attribute Not Equal Selector

       The First, Last, and Element at Index Selectors

       The Even and Odd Selectors

   Try This 2-2: More Selection Practice

   Chapter 2 Self Test

3 Event Handling

   Waiting for the Document to Be Ready

       ready() vs. load()

       What Is the Difference?

       Using the $ Argument with ready()

   Handling an Event

       Basic Event Handling

   jQuery Events

       Mouse Events

       Keyboard Events

       Other Events

       Event Capturing and Bubbling

       Using the on() Method to Handle Events

       Other Events

   Try This 3-1: Add Event Handlers

   Triggering Events

   Try This 3-2: Trigger Practice

   Chapter 3 Self Test

4 Working with Styles

   CSS Rules

   The css() Method

       Getting Values

       Setting Values

   Class Methods

       The addClass() and removeClass() Methods

       The toggleClass() Method

       The hasClass() Method

   Try This 4-1: Use toggleClass()

   Size and Position Methods

       The width() and height() Methods

       The innerWidth() and innerHeight() Methods

       The outerWidth() and outerHeight() Methods

       The offset() Method

       The position() Method

       The scrollLeft() and scrollTop() Methods

   Try This 4-2: Use offset()

   Chapter 4 Self Test

5 JavaScript and the Document Object Model

   Basic JavaScript

       Comments

       Variables and Data Types

       Operators

       Flow Control Statements

       Functions

       Arrays

       Objects

   Try This 5-1: Use JavaScript with jQuery

   The Document Object Model (DOM)

   The DOM and jQuery

       Attributes

       Creating New Elements

       Copying Elements

       Removing Elements

   Try This 5-2: Add Elements

   Chapter 5 Self Test

6 Animations and Effects

   Show and Hide Animation Methods

       The show() and hide() Methods

       The slideDown() and slideUp() Methods

       The fadeIn() and fadeOut() Methods

   Callback Functions

   Try This 6-1: Practice with slideDown()

   Creating Custom Animations

       Property/Value Map

       Duration Values

       Easing Values

       Callback Function

       The Second Form of animate()

       Updating the FAQ Page

   Try This 6-2: Chain on a Custom Animation

   Stopping Animations

   Chapter 6 Self Test

7 The Event Object

   The Event Object in jQuery

       Browser Inconsistencies

       About the Event Object

   Event Properties

       The type Property

       The timeStamp Property

       The which Property

   Try This 7-1: Practice Using which

   Event Methods

       The stopPropagation() Method

       The stopImmediatePropagation() Method

       The “is” Methods

   Try This 7-2: Practice Stopping Propagation

   Chapter 7 Self Test

8 The DOM and Forms

   Form Element Values

       The val() Method

   Form Events

       The blur() and focus() Methods

       The change() Method

       The select() Method

       The submit() Method

   Regular Expressions

       Creating Regular Expressions

       Testing Strings Against Regular Expressions

       Using Flags

   Try This 8-1: Practice Using Regular Expressions

   Form Validation

       Helpful HTML for Forms

       Helping the User

       Validating the Form

   Try This 8-2: Practice Validation

   Chapter 8 Self Test

9 Working with AJAX

   Introduction to AJAX

   Creating AJAX Requests

       Retrieving HTML

       Retrieving XML

       Retrieving JSON

   Try This 9-1: Practice Basic AJAX

   Two-Way AJAX Requests

       Using Get and Post Requests

       Handling Errors

       Form Input Serialization

   Try This 9-2: Practice Serialization

   Security Issues and Further Information

       Further Information

   Chapter 9 Self Test

10 Using Plugins

   Introduction to jQuery Plugins

   Using a Plugin

       Downloading and Installing a Plugin

       Calling the Method

       Setting Plugin Options

   Try This 10-1: Practice Using a Plugin

   Helpful Plugins

       jQuery UI

       Parsley.js

       ParamQuery Grid

       jKit

       jCanvas

   Try This 10-2: Practice with jQuery UI

   Chapter 10 Self Test

11 Creating Plugins

   Global Methods and the $ Alias

       Ensuring $ Is Available

       Creating Methods and Minimizing Naming Conflicts

   Creating jQuery Object Methods

       Extending the jQuery Object

       Using Implicit Iteration and Returning a jQuery Object

       User Customization with an Options Map

   Try This 11-1: Practice Plugin Options

   Adding a Callback Function

   Try This 11-2: Practice with Callbacks

   Chapter 11 Self Test

12 Advanced Techniques and Further Resources

   Debugging

       Simple Alerts

       Browser Developer Tools

       Using a Lint Tool

   Try This 12-1: Practice Using a Lint Tool

   Unit Testing

   Additional Resources

       jQuery Resources

       JavaScript Resources

       Contacting the Author

   Chapter 12 Self Test

A Answers to Self Tests

   Chapter 1: Getting Started with jQuery

   Chapter 2: Selecting Elements in the Document

   Chapter 3: Event Handling

   Chapter 4: Working with Styles

   Chapter 5: JavaScript and the Document Object Model

   Chapter 6: Animations and Effects

   Chapter 7: The Event Object

   Chapter 8: The DOM and Forms

   Chapter 9: Working with AJAX

   Chapter 10: Using Plugins

   Chapter 11: Creating Plugins

   Chapter 12: Advanced Techniques and Further Resources

Index

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.182.110