jQuery 1.4 Reference Guide

jQuery 1.4 Reference Guide
eBook: $23.99
Formats: PDF, PacktLib, ePub and Mobi formats
save 30%!
Print + free eBook + free PacktLib access to the book: $63.98    Print cover: $39.99
save 50%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Table of Contents
Sample Chapters
  • Quickly look up features of the jQuery library
  • Step through each function, method, and selector expression in the jQuery library with an easy-to-follow approach
  • Understand the anatomy of a jQuery script
  • Write your own plug-ins using jQuery's powerful plug-in architecture
  • Written by the creators of learningquery.com
  • Check out the new Learning jQuery Third Edition here

Book Details

Language : English
Paperback : 336 pages [ 235mm x 191mm ]
Release Date : January 2010
ISBN : 1849510040
ISBN 13 : 9781849510042
Author(s) : Jonathan Chaffer, Karl Swedberg
Topics and Technologies : All Books, Web Development, AJAX, jQuery, Open Source, Web Development

Table of Contents

Chapter 1: Anatomy of a jQuery Script
Chapter 2: Selector Expressions
Chapter 3: DOM Traversal Methods
Chapter 4: DOM Manipulation Methods
Chapter 5: Event Methods
Chapter 6: Effect Methods
Chapter 7: AJAX Methods
Chapter 8: Miscellaneous Methods
Chapter 9: jQuery Properties
Chapter 10: The Plug-in API
Chapter 11: Alphabetical Quick Reference
Appendix A: Online Resources
Appendix B: Development Tools
  • Chapter 1: Anatomy of a jQuery Script
    • A dynamic table of contents
      • Obtaining jQuery
      • Setting up the HTML document
      • Writing the jQuery code
    • Script dissection
      • Selector expressions
      • DOM traversal methods
      • DOM manipulation methods
      • Event methods
      • Effect methods
      • AJAX methods
      • Miscellaneous methods
      • Plug-in API
    • Summary
  • Chapter 2: Selector Expressions
    • CSS selectors
      • Element (T)
      • ID (#myid)
      • Class (.myclass)
      • Descendant (E F)
      • Child (E > F)
      • Adjacent sibling (E + F)
      • General sibling (E ~ F)
      • Multiple expressions (E, F, G)
      • Numbered child (:nth-child(n/even/odd/expr))
      • First child (:first-child)
      • Last child (:last-child)
      • Only child (:only-child)
      • Not (:not(E))
      • Empty (:empty)
      • Universal (*)
    • Attribute selectors
      • Attribute ([foo])
      • Attribute equals ([foo=bar])
      • Attribute does not equal ([foo!=bar])
      • Attribute begins with ([foo^=bar])
      • Attribute ends with ([foo$=bar])
      • Attribute contains ([foo*=bar])
      • Attribute contains word ([foo~=bar])
      • Attribute contains prefix ([foo|=bar])
    • Form selectors
    • Custom selectors
      • Element at index (:eq(n))
      • Greater than (:gt(n))
      • Less than (:lt(n))
      • First (:first)
      • Last (:last)
      • Even element (:even)
      • Odd element (:odd)
      • Is parent (:parent)
      • Contains text (:contains(text))
      • Contains element (:has(E))
      • Visible (:visible)
      • Hidden (:hidden)
      • Header element (:header)
      • Currently animating (:animated)
  • Chapter 3: DOM Traversal Methods
    • The jQuery function
      • $()
    • Filtering methods
      • .filter()
      • .not()
      • .has()
      • .eq()
      • .first()
      • .last()
      • .slice()
    • Tree traversal methods
      • .find()
      • .children()
      • .parents()
      • .parentsUntil()
      • .parent()
      • .closest()
      • .offsetParent()
      • .siblings()
      • .prev()
      • .prevAll()
      • .prevUntil()
      • .next()
      • .nextAll()
      • .nextUntil()
    • Miscellaneous traversal methods
      • .add()
      • .is()
      • .end()
      • .andSelf()
      • .map()
      • .contents()
  • Chapter 4: DOM Manipulation Methods
    • General attributes
      • .attr() (getter)
      • .attr() (setter)
      • .removeAttr()
    • Style properties
      • .css() (getter)
      • .css() (setter)
      • .height() (getter)
      • .height() (setter)
      • .innerHeight()
      • .outerHeight()
      • .width() (getter)
      • .width() (setter)
      • .innerWidth()
      • .outerWidth()
      • .offset() (getter)
      • .offset() (setter)
      • .position()
      • .scrollTop() (getter)
      • .scrollTop() (setter)
      • .scrollLeft() (getter)
      • .scrollLeft() (setter)
    • Class attributes
      • .hasClass()
      • .addClass()
      • .removeClass()
      • .toggleClass()
    • DOM replacement
      • .html() (getter)
      • .html() (setter)
      • .text() (getter)
      • .text() (setter)
      • .val() (getter)
      • .val() (setter)
      • .replaceWith()
      • .replaceAll()
    • DOM insertion, inside
      • .prepend()
      • .prependTo()
      • .append()
      • .appendTo()
    • DOM insertion, outside
      • .before()
      • .insertBefore()
      • .after()
      • .insertAfter()
    • DOM insertion, around
      • .wrap()
      • .wrapAll()
      • .wrapInner()
    • DOM copying
      • .clone()
    • DOM removal
      • .empty()
      • .remove()
      • .detach()
      • .unwrap()
  • Chapter 5: Event Methods
    • Event handler attachment
      • .bind()
      • .unbind()
      • .one()
      • .trigger()
      • .triggerHandler()
      • .live()
      • .die()
    • Document loading
      • .ready()
      • .load()
      • .unload()
      • .error()
    • Mouse events
      • .mousedown()
      • .mouseup()
      • .click()
      • .dblclick()
      • .toggle()
      • .mouseover()
      • .mouseout()
      • .mouseenter()
      • .mouseleave()
      • .hover()
      • .mousemove()
    • Form events
      • .focus()
      • .blur()
      • .change()
      • .select()
      • .submit()
    • Keyboard events
      • .keydown()
      • .keypress()
      • .keyup()
    • Browser events
      • .resize()
      • .scroll()
  • Chapter 6: Effect Methods
    • Pre-packaged effects
      • .show()
      • .hide()
      • .toggle()
      • .slideDown()
      • .slideUp()
      • .slideToggle()
      • .fadeIn()
      • .fadeOut()
      • .fadeTo()
    • Customized effects
      • .animate()
      • .stop()
      • .delay()
      • .queue()
      • .dequeue()
      • .clearQueue()
  • Chapter 7: AJAX Methods
    • Low-level interface
      • $.ajax()
      • $.ajaxSetup()
    • Shorthand methods
      • $.get()
      • .load()
      • $.post()
      • $.getJSON()
      • $.getScript()
    • Global AJAX event handlers
      • .ajaxComplete()
      • .ajaxError()
      • .ajaxSend()
      • .ajaxStart()
      • .ajaxStop()
      • .ajaxSuccess()
    • Helper functions
      • .serialize()
      • .serializeArray()
  • Chapter 8: Miscellaneous Methods
    • Setup methods
      • $.noConflict()
    • DOM element methods
      • .size()
      • .get()
      • .index()
    • Collection manipulation
      • .each()
      • $.grep()
      • $.makeArray()
      • $.inArray()
      • $.map()
      • $.merge()
      • $.unique()
      • $.extend()
      • $.trim()
      • $.param()
    • Introspection
      • $.isArray()
      • $.isFunction()
      • $.isPlainObject()
      • $.isEmptyObject()
      • $.isXMLDoc()
    • Data storage
      • .data()
      • .removeData()
  • Chapter 9: jQuery Properties
    • Global properties
      • $.browser
      • $.support
        • $.support.boxModel
        • $.support.cssFloat
        • $.support.hrefNormalized
        • $.support.htmlSerialize
        • $.support.leadingWhitespace
        • $.support.noCloneEvent
        • $.support.objectAll
        • $.support.opacity
        • $.support.scriptEval
        • $.support.style
        • $.support.tbody
    • jQuery object properties
      • .length
      • .selector
      • .context
  • Chapter 10: The Plug-in API
    • Using a plug-in
    • Developing a plug-in
      • Object method
      • Global function
      • Selector expression
    • Plug-in conventions
      • Use of the $ alias
      • Naming conventions
      • API standardization
  • Appendix A: Online Resources
    • jQuery documentation
    • JavaScript reference
    • JavaScript code compressors
    • JavaScript code decompressors
    • (X)HTML reference
    • CSS reference
    • Useful blogs
    • Web development frameworks using jQuery

Jonathan Chaffer

Jonathan Chaffer is a member of Rapid Development Group, a web development firm located in Grand Rapids, Michigan. His work there includes overseeing and implementing projects in a wide variety of technologies, with an emphasis in PHP, MySQL, and JavaScript. He also leads on-site training seminars on the jQuery framework for web developers. In the open source community, he has been very active in the Drupal CMS project, which has adopted jQuery as its JavaScript framework of choice. He is the creator of the Content Construction Kit, a popular module for managing structured content on Drupal sites. He is also responsible for major overhauls of Drupal's menu system and developer API reference. He lives in Grand Rapids with his wife, Jennifer.

Karl Swedberg

Karl Swedberg is a web developer at Fusionary Media in Grand Rapids, Michigan, where he spends much of his time making cool things happen with JavaScript. As a member of the jQuery team, he is responsible for maintaining the jQuery API site at api.jquery.com. He is also a member of jQuery's Board of Advisors and a presenter at workshops and conferences. When he isn't coding, he likes to hang out with his family, roast coffee in his garage, and exercise at the local CrossFit gym.

Code Downloads

Download the code and support files for this book.

Submit Errata

Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.


- 2 submitted: last submission 18 Mar 2014

Errata type: Typo | Page number: 24 | Errata date: 25 Mar 10

original text: $('p:nth-child(even)') selects the first and third because they are children 2 and 4 (both even numbers) of their parent =========================================================== I think this should be: $('p:nth-child(even)') selects the first and second because they are children 2 and 4 (both even numbers) of their parent =========================================================== notice that "second" not "third "

Errata type: Code | Page number: 32 | Errata date: 16 Mar 10

The examples for the Less Than selector wrongly shows gt. The examples work if lt is used instead. So this: # "$('li:gt(2)') selects all elements preceding the third one." Should read: "$('li:lt(2)') selects all # elements preceding the third one." And this: "$('.myclass:gt(1)') selects all elements with the class myclass preceding the second one" Should read: "$('.myclass:lt(1)') selects all elements with the class myclass preceding the second one"


Sample chapters

You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

Frequently bought together

jQuery 1.4 Reference Guide +    Koha 3 Library Management System =
50% Off
the second eBook
Price for both: £21.95

Buy both these recommended eBooks together and get 50% off the cheapest eBook.

What you will learn from this book


  • Explore the impressive jQuery JavaScript library and its capabilities with a real-world example
  • Investigate jQuery's plug-in architecture, using a variety of approaches to extend the library's capabilities
  • Pull information from the server without refreshing a page using the AJAX capabilities of jQuery
  • Build a small script that dynamically extracts the headings from an HTML document and assembles them into a table of contents for the page
  • Discover the Form plug-in for combining AJAX techniques with HTML forms
  • Explore the Dimensions plug-in for getting the size and position of any element on the page—even the document and browser window
  • Determine whether an element is visible by testing its current width and height using a :visible selector
  • Inspect the browser environment and individual jQuery objects using the properties of jQuery
  • Create an extremely powerful jQuery toolset using a combined set of a selector expression and a corresponding DOM traversal method
  • Get complete and functional jQuery-powered scripts in this example-packed book

In Detail

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.

Learn from the experts

In this book and eBook, the creators of the popular jQuery learning resource, learningquery.com, share their knowledge, experience, and enthusiasm to bring you a comprehensive reference to this popular JavaScript library.


The book is a detailed reference guide, and an invaluable resource for answers to all your queries about jQuery. It is intended to be a quick reference to help at times when you need to quickly confirm a feature of the library

Who this book is for

This book is for you if you are a web developer who wants a broad, organized view of all that jQuery library has to offer or a quick reference on their desk to refer to for particular details. Basic knowledge of HTML and CSS is required. You should be comfortable with the syntax of JavaScript, but no knowledge of jQuery is assumed.

This is a reference guide, not an introductory title and if you are looking to get started with jQuery (or JavaScript libraries in general) then you are looking for the companion title Learning jQuery 1.3.

Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software