Book Image

jQuery 1.4 Reference Guide

By : Jonathan Chaffer, Karl Swedberg, jQuery Foundation
Book Image

jQuery 1.4 Reference Guide

By: Jonathan Chaffer, Karl Swedberg, jQuery Foundation

Overview of this book

If you are looking for a comprehensive reference guide to this popular JavaScript library, this book and eBook is for you. To make optimal use of jQuery, it's good to keep in mind the breadth of capabilities it provides. You can add dynamic, interactive elements to your sites with reduced development time using jQuery.Revised and updated for version 1.4 of jQuery, this book offers an organized menu of every jQuery method, function, and selector. Each method and function is introduced with a summary of its syntax and a list of its parameters and return value, followed by a discussion, with examples where applicable, to assist in getting the most out of jQuery and avoiding the pitfalls commonly associated with JavaScript and other client-side languages.In this book you will be provided information about the latest features of jQuery that include Sizzle Selector, Native event delegation, Event triggering, DOM manipulation, and many more. You won't be confined to built-in functionality, you'll be able to examine jQuery's plug-in architecture and we discuss both how to use plug-ins and how to write your own. If you're already familiar with JavaScript programming, this book will help you dive right into advanced jQuery concepts. You'll be able to experiment on your own, trusting the pages of this book to provide information on the intricacies of the library, where and when you need it.This book is a companion to Learning jQuery 1.3. Learning jQuery 1.3 begins with a tutorial to jQuery, where the authors share their knowledge, experience, and enthusiasm about jQuery to help you get the most from the library and to make your web applications shine.jQuery 1.4 Reference Guide digs deeper into the library, taking you through the syntax specifications and following up with detailed discussions. You'll discover the untapped possibilities that jQuery 1.4 makes available, and polish your skills as you return to this guide time and again.
Table of Contents (19 chapters)
jQuery 1.4 Reference Guide
About the Authors
About the Reviewers


jQuery is a powerful, yet easy-to-use, JavaScript library that helps web developers and designers add dynamic, interactive elements to their sites, smoothing out browser inconsistencies and greatly reducing development time. In jQuery 1.4 Reference Guide, you can investigate this library's features in a thorough, accessible format.

This book offers an organized menu of every jQuery method, function, and selector. Entries are accompanied by detailed descriptions and helpful recipes that will assist you in getting the most out of jQuery, and avoiding the pitfalls commonly associated with JavaScript and other client-side languages. If you're still hungry for more, the book shows you how to cook up your own extensions with jQuery's elegant plug-in architecture.

You'll discover the untapped possibilities that jQuery makes available and hone your skills as you return to this guide time and again.

What this book covers

In Chapter 1, Anatomy of a jQuery Script, we'll begin by dissecting a working jQuery example. This script will serve as a roadmap for this book, directing you to the chapters containing more information on particular jQuery capabilities.

The heart of the book is a set of reference chapters, which allow you to quickly look up the details of any jQuery method. Chapter 2, Selector Expressions, lists every available selector for finding page elements.

Chapter 3, DOM Traversal Methods, builds on the previous chapter with a catalog of jQuery methods for finding page elements.

Chapter 4, DOM Manipulation Methods, describes every opportunity for inspecting and modifying the HTML structure of a page.

Chapter 5, Event Methods, details each event that can be triggered and reacted to by jQuery.

Chapter 6, Effect Methods, defines the range of animations built into jQuery, as well as the toolkit available for building your own.

Chapter 7, AJAX Methods, lists the ways in which jQuery can initiate and respond to server communication without refreshing the page.

Chapter 8, Miscellaneous Methods, covers the remaining capabilities of the jQuery library that don't neatly fit into the other categories.

Chapter 9, jQuery Properties, lists properties of the jQuery object that can be inspected for information about the browser environment.

With the catalog of built-in functionality concluded, we'll dive into the extension mechanisms jQuery makes available. Chapter 10, Plug-in API, reveals these powerful ways to enhance jQuery's already robust capabilities using a plug-in.

Chapter 11, Alphabetical Quick Reference, offers a handy list of all methods and their arguments.

Appendix A, Online Resources, provides a handful of informative web sites on a wide range of topics related to jQuery, JavaScript, and web development in general.

Appendix B, Development Tools, recommends a number of useful third-party programs and utilities for editing and debugging jQuery code within your personal development environment.

What you need for this book

This book is a reference guide, not a tutorial. As such, prior exposure to the jQuery library will be beneficial in navigating this reference. The book Learning jQuery 1.3 is well-suited for this purpose.

To understand jQuery concepts, some knowledge of JavaScript is required, and familiarity with HTML and CSS is helpful.

The jQuery library itself can be downloaded from The majority of examples in this book require only this library, a text editor, and a web browser. Some AJAX examples require web server software as well, such as Apache, but this requirement is avoided wherever possible.

Who this book is for

This reference is designed for web developers who want a broad, organized view of all that the jQuery library has to offer, or want a quick reference on their desks to refer to for particular details. Basic knowledge of HTML and CSS is required. You should be comfortable with the syntax of JavaScript, and have basic knowledge of jQuery to make best use of this book.


In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "The .removeAttr() method uses the JavaScript removeAttribute() function."

A block of code is set as follows:

  <li>list item 1</li>
  <li>list item 2</li>
  <li>list item 3</li>
  <li>list item 4</li>
  <li>list item 5</li>
  <li>list item 6</li>

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

  <meta http-equiv="Content-Type"
    content="text/html; charset=utf-8"/>
  <script src="jquery.js" type="text/javascript"></script>
  <script src="jquery.plug-in.js" type="text/javascript"></script>
  <script src="custom.js" type="text/javascript"></script>

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "After this code executes, clicks on Trigger the handler will also display the same message."


Warnings or important notes appear in a box like this.


Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an email to , and mention the book title via the subject of your message.

If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on or email to .

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.


Downloading the example code for the book

Visit to directly download the example code.

The downloadable files contain instructions on how to use them.


Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us to improve subsequent versions of this book. If you find any errata, please report them by visiting, selecting your book, clicking on the let us know link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our web site, or added to any list of existing errata, under the Erarata section of that title. Any existing errata can be viewed by selecting your title from


Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or web site name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.


You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.