Our Ironclad Guarantee
You must be satisfied. Try our print books for 30 days or our eBooks for 14 days. If they aren't the best you've ever used, you can return the books or cancel the eBooks for a prompt refund. No questions asked!
This book is Out of Print. The newest edition of this book is Murach's JavaScript and jQuery (4th Edition).
Go to our instructor’s site to learn more about this book and its instructor’s materials.
The aim of the book is to teach jQuery in an intensely hands-on way. It succeeds in this and probably provides the fastest way to learn and master the framework."
To get you off to the right start, section 1 presents a crash course in the JavaScript skills that you need for using jQuery. Although you can’t use jQuery without these JavaScript skills, most jQuery books don’t include them.
This section is especially designed for programming novices. But even if you already know JavaScript, you’ll probably pick up a few new skills as you skim through the chapters. (And our paired-pages format makes it easy to skim.)
In this section, you’ll learn how to use jQuery to create JavaScript applications like image swaps, collapsible panels, slide shows, carousels, user-friendly forms…and more…with far less coding than you’d have to do in native JavaScript.
To begin, chapter 7 presents the jQuery selectors, methods, and event methods that you’ll use most often. Then, the next four chapters build on that base as they focus on effects and animations, DOM manipulation and traversal, forms and data validation, the many plugins that are available for jQuery, and how to create your own plugins. When you complete this section, you can go on to any of the 3 sections that follow.
Besides the core jQuery library, jQuery provides the jQuery UI (User Interface) library. This library helps you build features that your site visitors may appreciate, all with just a few lines of code. So this section shows you how to use jQuery UI to create widgets like tabs, accordions, and datepickers...interactions like draggable, droppable, and sortable...and effects like color and class transitions.
Ajax and JSON are hot topics today. Together, they can be used to get data from a server and add it to a web page without reloading the entire page, which can significantly improve response times for users (if you’ve ever scrolled around a Google Map, you’ve seen this in action). But to be honest, the coding can be mind-bending. Fortunately, jQuery provides methods that make it far more manageable.
So in this section, you’ll learn how to use jQuery with Ajax and JSON to deliver data to your websites. First, you’ll learn the
basics. Then, you’ll learn how to work with the APIs for websites like Blogger, YouTube, Twitter, Flickr, and Google Maps to add popular content to your pages. This is a major use of Ajax and JSON…yet no other jQuery book shows you how to do it.
This section shows you how to use another JavaScript library, jQuery Mobile, to develop web pages for mobile devices with the look-and-feel of native applications. In fact, for jQuery users, there’s no better way to develop mobile websites right now. And you can add it to your skill set any time after you’ve finished Section 2.
You can think of jQuery as one of the 4 technologies that every professional web developer should master, along with HTML, CSS, and JavaScript. So this book is for:
The only prerequisite is a basic familiarity with HTML and CSS. We don’t expect you to code HTML and CSS, though, so we provide that code for all of the examples and exercises in the book. Then, when you’re ready to learn more, you can get Murach’s HTML5 and CSS3.
To develop JavaScript applications, you need:
Although you can use any text editor with this book, a text editor that includes syntax coloring and auto-formatting will help you
develop applications more quickly and with fewer errors. That’s why we recommend Aptana Studio 3. It’s available for free, it can be used for entering JavaScript and jQuery code (as well as HTML and CSS code), and it runs on both Windows and Mac OS.
To test a web page, you can use the default browser on your system. But we recommend that you also test your pages in Mozilla Firefox, which includes a terrific debugging tool called Firebug. In practice, you should also test your pages in Opera and Chrome, or in any other browser that your website visitors are likely to use, but that isn’t necessary as you learn. Again, all of these browsers are available for free.
To help you install these products, Appendix A provides the procedures that you’ll need. In addition, chapter 1 presents a short tutorial on using Aptana, and chapter 4 shows you how to use Firebug for debugging pages that are rendered in Firefox.
HTML5, CSS3, JavaScript, and jQuery work hand-in-hand these days, so our HTML5 and CSS3 book is the perfect companion to our jQuery book. It teaches you how to code HTML and CSS from scratch. And right from page 1, it shows you how to structure and design your pages using all of the most popular HTML5/CSS3 features, like semantic tags, drop shadows, rounded corners, gradients, accessible forms, embedded fonts, canvas…and more!
"I finished up Murach's Javascript and jQuery, and I am beyond impressed. This is a great book for someone with a beginner's level of programming and will take you through not only the code of JavaScript and jQuery, but the reasons why. This is not to say it isn't an excellent book for moderate to advanced programmers - the projects help quickly identify the uses and structure needed to get you from a limited background in JavaScript to up-and-running in no time."
- Jeremy Johnson; Review posted at DreamInCode.net
From Dr. Dobb's Must-Have Books for JavaScript: "The aim of the book is to teach jQuery in an intensely hands-on way. It succeeds in this and probably provides that fastest way to learn and master the framework."
- Andrew Binstock, Editor-in-Chief, Dr. Dobb's
"There are quite a few jQuery books out there, but most assume that you already know JavaScript. This one doesn’t. It begins with a crash course in JavaScript — a crash course which occupies almost 200 of the book’s 564 pages, and six of its 18 chapters. If you’re not up-to-speed on programming with JavaScript, you will be by the time you’re done."
- David Bolton, Software Developer and About.com host Review posted at Dice.com
"Your books are so good that I threw away my assigned JavaScript and jQuery book for my class and bought Murach's JavaScript and jQuery (which has, by the way, helped restore my 4.0 GPA)."
- Blaine Simcox, Student, Michigan
"Several years ago, I was told that jQuery was worth learning. After wasting time and money on books and tutorials, I had not gotten very far. Murach's JavaScript and jQuery is exactly what I needed. After reading Chapter 7, I skipped to Chapter 17. Within two hours I had rebuilt a mobile website using jQuery Mobile. A friend was interested in themes and widgets, so I did Chapter 12 next. Once again within a short time I had rebuilt some pages using jQuery UI with very satisfying results. Finally, I got back to Chapter 9 about DOM manipulation. The information here solved a problem that had me frustrated. This is an amazing book!"
- Andrew McConnell, Developer
"One of my favorite parts of the book is on using JavaScript and jQuery to consume popular public APIs. This makes the book all the more practical from the real-world perspective."
- Jason Ong, Site Editor, ASPNETWorld.com
"I use jQuery and JavaScript every day, and for more than 20 years of web application development, this is one of the best books I've used. I thought I knew a lot about jQuery and JavaScript, but this book taught me more. Thanks for a really well done book."
- Posted at an online bookseller
View the table of contents for this book in a PDF: Table of Contents (PDF)
Click on any chapter title to display or hide its content.
The components of a web application
How static web pages are processed
How dynamic web pages are processed
How JavaScript and jQuery are used for client-side processing
How the Email List application works
The HTML
The CSS
The JavaScript
How to use the HTML5 semantic elements
How to use the div and span elements
How to use the basic HTML attributes
How to provide CSS styles for an HTML page
How to code the basic CSS selectors
How to code CSS rule sets
How to run a JavaScript application
How to ensure cross-browser compatibility
How to create or import a project
How to open or close an HTML, CSS, or JavaScript file
How to change the colors that highlight the syntax
How to edit a file
How to run a JavaScript application
Two ways to include JavaScript in the head of an HTML document
How to include JavaScript in the body of an HTML document
How to code JavaScript statements
How to create identifiers
How to use comments
How to use objects, methods, and properties
The primitive data types
How to code numeric expressions
How to work with numeric variables
How to work with string and Boolean variables
How to use the parseInt and parseFloat methods
How to code conditional expressions
How to code if statements
How to code while and do-while loops
How to code for loops
The Miles Per Gallon application
The Test Scores application
How to get error messages with Firefox
Common JavaScript errors
How to use the window and document objects
How to use Textbox and Number objects
How to use Date and String objects
How to use DOM objects to change the text for an element
How to create and call an anonymous function
How to create and call a named function
When and how to use local and global variables
How to attach an event handler to an event
How to use an onload event handler to attach the other event handlers
The Miles Per Gallon application
The Email List application
Typical test phases for a JavaScript application
The three types of errors that can occur
Common JavaScript errors
How top-down coding and testing can simplify debugging
How to enable Firebug and find errors
How to use breakpoints and step through code
When and how to get error messages with other browsers
A simple way to trace the execution of your JavaScript code
When and how to view the source code
When and how to validate the HTML
How to create an array and refer to its elements
How to add and delete array elements
How to use for loops to work with arrays
How to use for-in loops to work with arrays
How to use the methods of an Array object
The user interface and HTML
The JavaScript
DOM scripting concepts
The Node interface
The Document and Element interfaces
The user interface, HTML, and CSS
The JavaScript
Another way the FAQs application could be coded
Usability
Accessibility
The FAQs application with improved accessibility
How to cancel the default action of an event
How to preload images
The HTML and CSS
The JavaScript
How to use a one-time timer
How to use an interval timer
The HTML and CSS
The JavaScript
What jQuery is
How to include jQuery in your web pages
How jQuery can simplify JavaScript development
How jQuery can affect testing and debugging
How jQuery UI and plugins can simplify JavaScript development
How to code jQuery selectors
How to call jQuery methods
How to use jQuery event methods
The user interface and HTML
The jQuery
The most useful selectors
The most useful methods
The most useful event methods
Other event methods that you should be aware of
The FAQs application in jQuery
The Image Swap application in jQuery
The Image Rollover application in jQuery
The jQuery methods for effects
The FAQs application with jQuery effects
The user interface, HTML, and CSS
Two ways to code the jQuery
How to stop and start a slide show
How to use the basic syntax of the animate method
How to chain animate methods
How to use the delay and stop methods
How to use easings with effects and animations
How to use the advanced animate syntax and the methods for working with queues
The user interface, HTML, and CSS
The jQuery
The methods for working with attributes
The methods for DOM replacement
The methods for DOM insertion and cloning
The methods for DOM wrapping and removal
The user interface and HTML
The jQuery
The methods for working with styles
The methods for positioning elements
The enhanced TOC application
The tree traversal methods
The filtering methods
A Slide Show application that uses DOM traversal methods
How forms work
The HTML5 and CSS3 features for working with forms
The jQuery selectors and methods for forms
The jQuery event methods for forms
The user interface and HTML
Some of the JavaScript for the application
How to use the validation plugin
The options and default error messages for the validation plugin
The user interface
The HTML
The CSS
How to find jQuery plugins
Some of the most useful plugins
How to use any plugin
How to use the Lightbox plugin for images
How to use the bxSlider plugin for carousels
How to use the Cycle plugin for slide shows
How to use the jLayout plugin for two-column layouts
The structure of a plugin
How to code a plugin that highlights menu items
How to add options to a plugin
The user interface
The script elements
The HTML for the elements used by the plugins
The jQuery for using the plugins
What jQuery UI is and where to get it
The jQuery UI components
How to build a download
How to use ThemeRoller to build a custom theme
How to use the downloaded folders and files
How to use any widget
How to use the Accordion widget
How to use the Tabs widget
How to use the Button and Dialog widgets
How to use the Autocomplete widget
How to use the Datepicker widget
How to use the Slider widget
How to use the Progressbar widget
The user interface
The link and script elements
The HTML for the widgets
The jQuery for the widgets
Introduction to interactions
How to use the draggable and droppable interactions
How to use the resizable interaction
How to use the selectable interaction
How to use the sortable interaction
Introduction to effects
How to use individual effects
How to use color transitions
How to use class transitions
How to use visibility transitions
How Ajax works
Common data formats for Ajax
The members of the XMLHttpRequest object
How to use the XMLHttpRequest object
The jQuery shorthand methods for working with Ajax
How to use the load method to load HTML data
How to use the $.get or $.post method to load XML data
How to use the $.getJSON method to load JSON data
How to send data with an Ajax request
The syntax of the $.ajax method
How to use the $.ajax method to load data
Introduction to Google’s Blogger
How to use the API for Blogger
How to use an online JSON editor to review the feed from a web site
How to use Ajax and JSON to display Blogger posts
How to use the API for YouTube
The query parameters and data items that you’ll use the most
How to list videos by channel
How to list videos by search term
How to play videos in a video player on your site
How to use the API for Twitter
How to display the tweets for a user
How to convert the URLs within tweets to links
How to display a timestamp for each tweet
How to use the API for Flickr
The query parameters and data items that you’ll use the most
How to display titles and descriptions for a Flickr photo feed
How to display a gallery of Flickr photos
Introduction to the Google Maps API
The classes for adding a Google map to a web page
The script element for the Google Maps API
How to add a Google map to a web page
The classes and methods for geocoding and markers
How to create an address list that displays markers
The classes and methods for messages and markers
How to add messages to markers
How to add custom messages to markers
How to add Flickr images to messages
The classes and methods for directions and listeners
How to display driving directions on your own site
How to provide pages for mobile devices
How to use a JavaScript plugin to redirect mobile browsers to a mobile web site
How to set the viewport properties
Guidelines for designing mobile web pages
Guidelines for testing mobile web pages
What jQuery Mobile is and where to get it
How to include jQuery Mobile in your web pages
How to create one web page with jQuery Mobile
How to code multiple web pages in a single HTML file
How to use dialogs and transitions
How to create buttons
How to create a navigation bar
How to work with the default styles
How to apply theme swatches to HTML elements
How to use ThemeRoller to roll your own theme
The layout of the web site
The HTML for the mobile web site
The style sheet for the mobile web site
The components of jQuery Mobile
The data attributes of jQuery Mobile
The events and methods of jQuery Mobile
How to lay out content in grids
How to use collapsible content blocks
How to use collapsible sets
How to use basic lists
How to use split button lists and inset lists
How to use list dividers and count bubbles
How to use search filter bars
How to use text fields and text areas
How to use sliders and switches
How to use radio buttons and check boxes
How to use select menus
How to submit a form
The layout of the web site
The HTML
The style sheet
On a Windows system
On a Mac OS system
How to install Firefox
How to install Firebug
For Windows users
For Mac OS users
If you already know the basics of JavaScript, this chapter will quickly show you how jQuery makes JavaScript programming easier…and you’ll learn a working subset of jQuery that lets you start using it yourself. Four complete applications illustrate each point along the way and give you practical ideas for incorporating jQuery into your own web pages.
Chapter 7 PDF (1.2Mb) Download Now
Chapter 7 ePub (1.3Mb) Download Now
This download includes:
Appendix A in the book shows how to install and use these files on Windows and Mac systems.
Exe file for Windows (14.9Mb) Download Now
Zip file for any system (14.9Mb) Download Now
Below are the answers to the questions that have come up most often about this book. If you have any questions that aren’t answered here, please email us. Thanks!
This error message indicates that you don’t have a version of Node.js on your computer that is compatible with the version of Aptana that you’re installing. If you see this message, exit from the Aptana installer. Then, go to this website address to automatically download an installer file named node-v0.10.13-x86.msi: http://go.aptana.com/installer_nodejs_windows. Finally, run this installer file. After that, you should be able to install Aptana without any problem.
The instructions on pages 34 and 35 of our book for creating a project from the folder that contains the downloadable applications for the book was written for Aptana Studio 3.0, which was the current version when the book was published.
Since then, Aptana Studio 3.4 has been released, and you can no longer use the same procedure to create a project from an existing folder. Instead, you have to import the folder as a new project.
To import a folder, use the File→Import command to start the Import wizard. Then, in the first dialog box, expand the General folder, select Existing Folder as New Project, and click the Next button. In the next dialog box, enter or browse to the folder that contains the project files. Then, enter a name for the project, make sure the Web – Primary project type is selected, and click the Finish button.
The January 2013 release of jQuery, jQuery 1.9, had changes that affected applications that were written under earlier releases. Unfortunately, this release broke some of the applications in our book.
Fortunately, we discovered the problem early and fixed this in the downloads for this book on January 25, 2013. As a result, all of the applications should work unless you downloaded the applications before that date.
If you did download the applications before January 25, 2013, you should either download them again OR make the change that follows to any applications that don’t work correctly.
Change the script element that refers to the “latest” release of jQuery:
When YouTube upgraded its Data API v1 to API v2, the applications described on pages 440-448 of our jQuery book stopped working. That’s because Data API v1 no longer allows “free” connections to the YouTube Data API feed. YouTube now performs OAuth authorization by checking for the presence of a local file (typically named auth.js) that contains authorization credentials in the form of a client ID. The file containing the authorization credentials is then linked into the web page making the JSON request.
Also of note, the YouTube Data API v2 is now deprecated. The current version of the YouTube Data API is version 3.0. Because of the fluid nature of this API, YouTube applications like the ones in the book no longer make sense.
When Twitter upgraded to API 1.1, the applications described on pages 452-457 of our jQuery book stopped working. That’s because API 1.1 no longer allows “free” connections to the Twitter JSON API feed.
Now, to access that feed, you have to register an application with Twitter, add an authentication token to your site, and consume both the OAuth class and the classic server_messages class. Because of these difficulties, Twitter applications like the ones in our book are no longer practical.
To view the corrections for this book in PDF format, just click on this link:
Then, if you find any other errors, please email us so we can correct them in the next printing of the book. Thank you!
The January 2013 release of jQuery, jQuery 1.9, had changes that affected applications that were written under earlier releases, causing them not to run. Unfortunately, the broken applications included a few of the applications in our book. For all the details, please view this PDF:
We fixed the downloads for this book on January 25, 2013. And we fixed the text in its second printing in September 2013. So if you have a copy of the book from the second or subsequent printing, these corrections won’t be an issue.
To tell which printing your book is in, look on the back of the title page, below the copyright notation, to find a series of numbers like this:
10 9 8 7 6 5 4 3 2
The number on the right of this sequence tells which printing your book is. In this example, it’s the second printing.
For orders and customer service:
1-800-221-5528
Weekdays, 8 to 4 Pacific Time
If you're a college instructor who would like to consider a book for a course, please visit our website for instructors to learn how to get a complimentary review copy and the full set of instructional materials.