3.3. But it was probably too fast for you to notice...Break Neck Pizza isn't called "break neck" for nothingthe request to get your address and the response from the server happens so fast that you probably don't have time to start typing in your ordermuch less improve your golf gamebefore your address pops up. As soon as you type in your phone number, the browser sends a request for your address to the server.
JavaScript Customer's
Phone Number PHP script
JavaScript Customer's PHP Script
No time for typing or golf here!
The server responds with your
address almost immediately.
Address
You probably see your address pop up right away, before you have a chance to do anything else. |
3.4. What does asynchronous get you?So what's the point of an "asynchronous" application if the server responds so fast that it doesn't make a difference anyway?
Both of the applications you've built so far are asynchronous. Still, the server responded so fast to your
But what happens if it takes a really long time to get the data back from the server? Or what if you really do need to do two things at one time? You'd like to keep using the application while that's happening, right?
That's when you'll really see the benefits of the "asynchronous" part of Ajax. In fact, you're going to build another applicationan Ajax-
|
3.5. Building an Ajax-
|
3.6. Three
|