SKIP THE SHIPPING
Use code NOSHIP during checkout to save 40% on eligible eBooks, now through January 5. Shop now.
Register your product to gain access to bonus material or receive a coupon.
100+ Practical jQuery Recipes for Solving Your Real-World Web and Mobile Development Challenges!
jQuery makes it easier than ever for developers to build exceptionally robust, cross-platform websites and mobile apps. jQuery, jQuery UI, and jQuery Mobile: Recipes and Examples is a practical “cookbook,” packed with realistic, easy-to-use solutions for making the most of jQuery Core, jQuery UI, plugins, and jQuery Mobile.
This guide brings together more than one hundred self-contained, downloadable examples, each with an in-depth explanation of how the code works and how to adapt it for your own needs. Pioneering web/mobile developers Adriaan de Jonge and Phil Dutson present examples you can apply immediately in virtually any web or mobile app, and with any server-side platform, including PHP, .NET, Java, Ruby, Node.js, or Python. This extremely useful guide will help you
The authors’ proven “code first, explain later” approach supports developers at all levels who want to start experimenting immediately. Their exceptionally readable examples never take shortcuts or compromise quality,and their detailed walk-throughs are ideal for anyone who wants to thoroughly understand their code. If you have a working knowledge of HTML, CSS, and basic JavaScript, you’ll feel right at home immediately; if not, de Jonge and Dutson’s careful explanations and full HTML page layout examples will get you up to speed quickly.
Covers jQuery 1.6.4 and 1.7, with Tips for 1.8
Download free source code files for jQuery, jQuery UI, and jQuery Mobile: Recipes and Examples here
jQuery, jQuery UI, and jQuery Mobile: Communicating with the Server
Download the sample pages (includes Chapter 5 and Index)
Preface xix
Acknowledgments xxiii
About the Author xxv
Part I: Core 1
Chapter 1: Getting Started with jQuery 3
Recipe: Introducing the Basic Usage of jQuery 3
Recipe: Using jQuery with Other Libraries 6
Recipe: Determining the jQuery Version 7
Recipe: Iterating Arrays with each() 8
Recipe: Manipulating Arrays by Using map() 9
Recipe: Working with Arrays of Elements 10
Recipe: Getting the Position of an Element by Using index() 12
Recipe: Finding Elements in an Array by Using grep() 13
Recipe: Determining the Size of an Element Set by Using length() 14
Recipe: Retrieving HTML5 data- Attributes 15
Recipe: Storing Element Data by Using data() 16
Recipe: Removing Element Data by Using removeData() 18
Recipe: Testing and Manipulating Variables 19
Recipe: Extending Objects by Using extend() 22
Recipe: Serializing the Data in a Form 24
Recipe: Testing Browsers for Feature Support 25
Summary 26
Chapter 2: Selecting Elements 27
Recipe: Combining Two Element
Sets by Using add() 27
Recipe: Refining the Selection by Using filter() 28
Recipe: Selecting Descendants by Using find() and children() 29
Recipe: Selecting Elements by Using
has() and Testing by Using is() 31
Recipe: Selecting Form Elements by
Using Pseudo-Selectors 32
Recipe: Nesting Selectors 33
Recipe: Emulating a CSS Hover Selector 34
Recipe: Selecting on Text by Using contains() 35
Example: Highlighting a Single Word 36
Recipe: Creating Custom Selectors 37
Recipe: Scoping the Selection Context 39
Summary 40
Chapter 3: Modifying the Page 41
Recipe: Adding Classes 41
Example: Removing Classes 42
Recipe: Generating Class Names 43
Recipe: Changing Properties and Attributes 45
Recipe: Changing the HTML Contained within an Element 46
Recipe: Adding Content by Using append() and appendTo() 48
Example: Appending the Outcome of a Function 49
Recipe: Adding Content by Using prepend() and prependTo() 50
Recipe: Generating HTML Dynamically
by Using jQuery 51
Recipe: Attaching and Detaching Elements 53
Recipe: Copying Elements by Using clone() 54
Recipe: Inserting Elements at Specific Positions 56
Example: Moving Items Up and Down the List 58
Recipe: Removing Elements 60
Recipe: Wrapping and Unwrapping Elements 61
Summary 64