you’re on your way 4
3
next generation applications
Welcome to the new millenium!
Anybody can program using the same old request/response
model. But if you want faster apps that feel like you’re
working on a desktop, you need something new—you need
Ajax, a completely different approach to web programming:
For the web server, nothing has
changed; it still responds to each
request, just as it did before.
JavaScript
Request
This JavaScript code makes a
request to the server.
Web Server
Response
The JavaScript
dynamically
updates the web
page, without
redrawing
everything. Sweet!
Web Server
No more waiting around...
...when you’re using Ajax apps
The web page sends its requests
using a JavaScript function, which
handles talking to the server.
The server’s response has only the
data the page needs... without any
markup or presentation.
<script>
var request...
function foo()
{
...
}
</script>
<script>
var request...
function foo()
{
...
}
</script>
Update
JavaScript
Most of the page doesn’t change...
only the parts of the page that
need to change are updated.