Welcome to the Next Generation!

Head Rush Ajax

Sick of creating web sites that reload every time a user moves the mouse? Tired of servers that wait around to respond to users' requests for movie tickets? It sounds like you need a little (or maybe a lot of) Ajax in your life. Asynchronous programming lets you turn your own web sites into smooth, slick, responsive applications that make your users feel like they're back on the information superhighway, not stuck on a dial-up backroad.

But who wants to take on next-generation programming with the last generation's instruction book? You need a learning experience that's as compelling and cutting-edge as the sites you want to design. That's where we come in. With Head Rush Ajax, in no time you'll be writing JavaScript code that fires off asynchronous requests to web servers... and having fun doing it. By the time you've taken your dynamic HTML, XML, JSON, and DOM skills up a few notches, you'll have solved tons of puzzles, figured out how well snowboards sell in Vail, and even watched a boxing match. Sound interesting? Then what are you waiting for? Pick up Head Rush Ajax and learn Ajax and asynchronous programming the right way-the way that sticks.

If you've ever read a Head First book, you know what to expect: a visually rich format designed for the way your brain works. Head Rush ramps up the intensity with an even faster look and feel. Have your first working app before you finish Chapter 1, meet up with the nefarious PROJECT: CHAOS stealth team, and even settle the question of the Top 5 Blues CDs of all time. Leave boring, clunky web sites behind with 8-tracks and hot pants-and get going with next generation web programming.

Read Me: What you should know before reading this book

This is a learning experience, not a reference book. We deliberately stripped out everything that might get in the way of learning whatever it is we're working on at that point in the book. And the first time through, you need to begin at the beginning, because the book makes assumptions about what you've already seen and learned.

We assume you are familiar with HTML and CSS.

It would take an entire book to teach you HTML and CSS (in fact, that's exactly what it took: Head First HTML with CSS & XHTML). We chose to focus this book on Ajax programming, rather than rehash lots of markup and style that you could learn about in other places.

We assume you've at least seen JavaScript code before.

It would take an entire book to teach you... oh, wait, we've already said that. Seriously, JavaScript is a lot more than a simple scripting language, and we aren't going to cover all the ways you can use JavaScript in this book. You'll learn about all the ways that JavaScript is related to Ajax programming, and learn how to use JavaScript extensively to add interaction to your web pages and make requests to a server.

However, if you've never written a line of JavaScript, aren't at all familiar with functions or curly braces, or have never programmed in any language before, you might want to pick up a good JavaScript book and browse through it. If you want to plow into this book, feel free—but we will be moving fairly quickly over the basics.

We don't cover server-side programming in this book.

It's now common to find server-side programs written in Java, PHP, Ruby, Python, Perl, Ruby on Rails, C#, and a whole lot more. Ajax programming works with all of these languages, and we have tried to represent several of them in this book's examples.

To keep you focused on learning Ajax, though, we do not spend much time explaining the server-side programs used; we'll show you the server-side code with some notes, but that's as far as we go. We believe that your Ajax applications can be written to work with any kind of server-side program; we also believe that you're smart enough to apply the lessons learned from an example that uses PHP to one that uses Ruby on Rails or a Java servlet.

We encourage you to use more than one browser with this book.

As much as it sucks, different web browsers handle your HTML, your CSS, and your JavaScript in completely different ways. If you want to be a complete Ajax programmer, you should always test your asynchronous applications on lots of modern browsers. All the examples in this book were tested on recent versions of Firefox, Opera, Safari, Internet Explorer, and Mozilla. If you find problems, though, let us know... we promise it's an accident.

Online Examples

Book code and downloads

Note: This code won't work unless you have PHP installed on your machine. We're working on getting some Head-First-style documentation for doing that, but in the meantime you can see this discussion on the Head Rush Ajax forum regarding different easy ways to get PHP.
(opens a new window)

Read it on Safari

(opens a new window)

Buy 2 books, get 1 free!

Buy 2 books and get the third free! Use the coupon code OPC10 when you check out.

Who is this book for?

If you can answer "yes" to all of these:

  • Do you know HTML, some CSS, and some JavaScript? (You don't need to be a guru.)
  • Do you want to learn, understand, and remember Ajax, with a goal of developing more responsive web applications?
  • Do you prefer stimulating dinner party conversation to dry, dull, academic lectures?

You should probably back away from this book if you can answer "yes" to any of these:

  • Are you completely new to HTML or CSS or JavaScript? (You don't need to be advanced, but you should definitely have some experience. If not, go get a copy of Head First HTML and CSS, today, and then come back and get this book.)
  • Are you a kick-butt Ajax developer looking for a reference book?
  • Are you afraid to try something different? Would you rather have a root canal than mix stripes with plaid? Do you believe that a technical book can't be serious if Java components are anthropomorphized?