Gift Guide

Ajax Hacks: Tips & Tools for Creating Responsive Web Sites


Ajax, the popular term for Asynchronous JavaScript and XML, is one of the most important combinations of technologies for web developers to know these days. With its rich grouping of technologies, Ajax developers can create interactive web applications with XML-based web services, using JavaScript in the browser to process the web server response.

Taking complete advantage of Ajax, however, requires something more than your typical "how-to" book. What it calls for is Ajax Hacks ...

See more details below
$23.45 price
(Save 21%)$29.99 List Price

Pick Up In Store

Reserve and pick up in 60 minutes at your local store

Other sellers (Paperback)
  • All (38) from $1.99   
  • New (7) from $11.19   
  • Used (31) from $1.99   
Ajax Hacks: Tips & Tools for Creating Responsive Web Sites

Available on NOOK devices and apps  
  • NOOK Devices
  • Samsung Galaxy Tab 4 NOOK 7.0
  • Samsung Galaxy Tab 4 NOOK 10.1
  • NOOK HD Tablet
  • NOOK HD+ Tablet
  • NOOK eReaders
  • NOOK Color
  • NOOK Tablet
  • Tablet/Phone
  • NOOK for Windows 8 Tablet
  • NOOK for iOS
  • NOOK for Android
  • NOOK Kids for iPad
  • PC/Mac
  • NOOK for Windows 8
  • NOOK for PC
  • NOOK for Mac
  • NOOK for Web

Want a NOOK? Explore Now

NOOK Book (eBook)
$13.49 price
(Save 43%)$23.99 List Price


Ajax, the popular term for Asynchronous JavaScript and XML, is one of the most important combinations of technologies for web developers to know these days. With its rich grouping of technologies, Ajax developers can create interactive web applications with XML-based web services, using JavaScript in the browser to process the web server response.

Taking complete advantage of Ajax, however, requires something more than your typical "how-to" book. What it calls for is Ajax Hacks from O'Reilly. This valuable guide provides direct, hands-on solutions that take the mystery out of Ajax's many capabilities. Each hack represents a clever way to accomplish a specific task, saving you countless hours of searching for the right answer.

A smart collection of 80 insider tips and tricks, Ajax Hacks covers all of the technology's finer points. Want to build next-generation web applications today? This book can show you how. Among the multitude of topics addressed, it shows you techniques for:

  • Using Ajax with Google Maps and Yahoo Maps
  • Displaying data
  • Scraping stock quotes
  • Fetching postal codes
  • Building web forms with auto-complete functionality

Ajax Hacks also features a number of advanced hacks for accelerated web developers. Discover how to create huge, maintainable bookmarklets, how to use client-side storage for Ajax applications, and how to call a built-in Java object from JavaScript using Ajax. The book even addresses best practices for testing Ajax applications and improving maintenance, performance, and reliability for JavaScript code.

The latest in O"Reilly's celebrated Hacks series, Ajax Hacks smartly complements other O'Reilly titles such as Head Rush Ajax and JavaScript: The Definitive Guide.

Read More Show Less

Product Details

  • ISBN-13: 9780596101695
  • Publisher: O'Reilly Media, Incorporated
  • Publication date: 3/28/2006
  • Series: Hacks Series
  • Edition number: 1
  • Pages: 448
  • Sales rank: 1,319,513
  • Product dimensions: 6.32 (w) x 9.04 (h) x 1.08 (d)

Meet the Author

Bruce Perry is an independent Java software developer and writer. Since 1996, he has developed web applications and databases for various nonprofits, design and marketing firms, and ad agencies. When not hacking or writing, he loves cycling and climbing mountains in the U.S. and Switzerland. He lives in Massachusetts with his wife Stacy LeBaron, daughter Rachel, and son Scott.

Read More Show Less

Table of Contents

About the Author;
Building Single-Page Applications;
Explaining Ajax;
How to Use This Book;
How This Book Is Organized;
Conventions Used in This Book;
Using Code Examples;
Safari Enabled;
How to Contact Us;
Got a Hack?;
Chapter 1: Ajax Basics;
It’s Not a Floor Wax;
Handle with Care;
1 Detect Browser Compatibility with the Request Object;
2 Use the Request Object to POST Data to the Server;
3 Use Your Own Library for XMLHttpRequest;
4 Receive Data as XML;
5 Get Plain Old Strings;
6 Receive Data as a Number;
7 Receive Data in JSON Format;
8 Handle Request Object Errors;
9 Dig into the HTTP Response;
10 Generate a Styled Message with a CSS File;
11 Generate a Styled User Message on the Fly;
Chapter 2: Web Forms;
12 Submit Text Field or textarea Values to the Server Without a Browser Refresh;
13 Display Text Field or textarea Values Using Server Data;
14 Submit Selection-List Values to the Server Without a Round Trip;
15 Dynamically Generate a New Selection List Using Server Data;
16 Extend an Existing Selection List;
17 Submit Checkbox Values to the Server Without a Round Trip;
18 Dynamically Generate a New Checkbox Group with Server Data;
19 Populate an Existing Checkbox Group from the Server;
20 Change Unordered Lists Using an HTTP Response;
21 Submit Hidden Tag Values to a Server Component;
Chapter 3: Validation;
22 Validate a Text Field or textarea for Blank Fields;
23 Validate Email Syntax;
24 Validate Unique Usernames;
25 Validate Credit Card Numbers;
26 Validate Credit Card Security Codes;
27 Validate a Postal Code;
Chapter 4: Power Hacks for Web Developers;
28 Get Access to the Google Maps API;
29 Use the Google Maps API Request Object;
30 Use Ajax with a Google Maps and Yahoo! Maps Mash-up;
31 Display a XML Data Feed;
32 Use Ajax with a Yahoo! Maps and GeoURL Mash-up;
33 Debug Ajax-Generated Tags in Firefox;
34 Fetch a Postal Code;
35 Create Large, Maintainable Bookmarklets;
36 Use Permanent Client-Side Storage for Ajax Applications;
37 Control Browser History with iframes;
38 Send Cookie Values to a Server Program;
39 Use XMLHttpRequest to Scrape an Energy Price from a Web Page;
40 Send an Email with XMLHttpRequest;
41 Find the Browser’s Locale Information;
42 Create an RSS Feed Reader;
Chapter 5: Direct Web Remoting (DWR)for Java Jocks;
43 Integrate DWR into Your Java Web Application;
44 Use DWR to Populate a Selection List from a Java Array;
45 Use DWR to Create a Selection List from a Java Map;
46 Display the Keys/Values from a Java HashMap on a Web Page;
47 Use DWR to Populate an Ordered List from a Java Array;
48 Access a Custom Java Object with JavaScript;
49 Call a Built-in Java Object from JavaScript Using DWR;
Chapter 6: Hack Ajax with the Prototype and Rico Libraries;
50 Use Prototype’s Ajax Tools with Your Application;
51 Update an HTML Element’s Content from the Server;
52 Create Observers for Web Page Fields;
53 Use Rico to Update Several Elements with One Ajax Response;
54 Create a Drag-and-Drop Bookstore;
Chapter 7: Work with Ajax and Ruby on Rails;
Sensible MVC;
55 Install Ruby on Rails;
56 Monitor Remote Calls with Rails;
57 Make Your JavaScript Available to Rails Applications;
58 Dynamically Generate a Selection List in a Rails Template;
59 Find Out Whether Ajax Is Calling in the Request;
60 Dynamically Generate a Selection List Using Database Data;
61 Periodically Make a Remote Call;
62 Dynamically View Request Information for XMLHttpRequest;
Chapter 8: Savor the JavaScript Library;
63 Integrate Visual Effects with an Ajax Application;
64 Create a Login Box That Shrugs Off Invalid Logins;
65 Create an Auto-Complete Field with;
66 Create an In-Place Editor Field;
67 Create a Web Form That Disappears When Submitted;
Chapter 9: Options and Efficiencies;
68 Fix the Browser Back Button in Ajax Applications;
69 Handle Bookmarks and Back Buttons with RSH;
70 Set a Time Limit for the HTTP Request;
71 Improve Maintainability, Performance, and Reliability for Large JavaScript Applications;
72 Obfuscate JavaScript and Ajax Code;
73 Use a Dynamic script Tag to Make Web Services Requests;
74 Configure Apache to Deal with Cross-Domain Issues;
75 Run a Search Engine Inside Your Browser;
76 Use Declarative Markup Instead of Script via XForms;
77 Build a Client-Side Cache;
78 Create an Auto-Complete Field;
79 Dynamically Display More Information About a Topic;
80 Use Strings and Arrays to Dynamically Generate HTML;

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star


4 Star


3 Star


2 Star


1 Star


Your Rating:

Your Name: Create a Pen Name or

Barnes & Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation


  • - By submitting a review, you grant to Barnes & and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Terms of Use.
  • - Barnes & reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing all of 4 Customer Reviews
  • Anonymous

    Posted March 2, 2011


    test review

    0 out of 1 people found this review helpful.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted September 16, 2006


    Do you want to add extra interactivity to your web site? If you do, then this book is for you! Author Bruce Perry, has done an outstanding job of writing a book that collects not only dozens of easy-to-grasp, cutting-edge explorations of Ajax technology, such as Google/Yahoo! mapping mash-ups, drag-and-drop bookstores, and single-page web services apps, but a large number of hacks that represent practical advice for Ajax developers. Perry, begins with a synopsis of the group of well-known technologies that make up Ajax. Then, the author shows how typical it is now to submit form data and to build form widgets such as select lists and checkbox groups using server data fetched in the background with XMLHttpRequest. Next, the author discusses how Ajax applications can cut down on server hits by validating the format of e-mail addresses, credit card numbers, zip codes, and other types of data that users enter into web forms before sending the data. The author then covers a mash-up of Google Maps, Yahoo! Maps, and Yahoo! driving directions, as well as a software interaction involving Yahoo! Maps and a location-to-URL service called GeoURL. The author continues by discussing Ajax as it relates to developers who are immersed in both Java and JavaScript. He also discusses how to use Prototype, a cool open source JavaScript library that includes its own Ajax tools. Next, the author shows you how to get up and running with RoR and then, moves on to several hacks that illustrate RoR¿s Ajax tools. Then, he covers, which is another opensource JavaScript library built on Prototype. Finally, the author provides several tips for real-world Ajax developers. This most excellent book introduces JavaScript newbies and aficionados alike to useful code libraries, including Prototype, Rico, and More importantly, web developers can adapt a number of this book¿s hacks, some of which are distributed as open source libraries, for their own applications.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted April 21, 2006

    Great introduction to Ajax

    Ajax is wicked cool. If you¿re not sure what it is, it stands for Asynchronous Javascript And Xml, and allows you to pull data from a webserver, and refresh part of your web page without implementing a full post-back. An excellent example of an Ajax website is Google maps. This book does an impressive job of showing the basics of ajax as well as providing a bunch of recipes for adding ajax functionality to your websites. The books contains 80 different ajax hacks, which cover everything from working with web forms, to web form validation, to running a search engine inside your browser. The book also contains some great information on DWR (Direct Web Remoting) and Ruby on Rails. I found many of the hacks very interesting and very applicable to what I need to do in my day-to-day work. The author is very clear in his examples and engaging in his writing. This is a very interesting book to read and is an excellent introduction to ajax. I would highly recommend it to web developers interested in learning more about this exciting technology.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted October 16, 2008

    No text was provided for this review.

Sort by: Showing all of 4 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)