Skip to Content
Head Rush Ajax
book

Head Rush Ajax

by Brett McLaughlin
March 2006
Beginner to intermediate
448 pages
13h 33m
English
O'Reilly Media, Inc.
Content preview from Head Rush Ajax
you’re on your way 4
41
next generation applications
The browser isn’t doing anything that tricky. When your JavaScript needs
to make a request, you write code like this:
All the browser does is handle the low-level network stuff that makes this
code work. Since network connections work differently on each operating
system (think Linux and Windows and Mac OS X), the browser handles
the stuff specic to each system. That way, your JavaScript will work
on any system—and the browser takes care of turning your code into
something each user’s particular computer understands.
Take a look back at page 40, and notice that it’s the browser that actually
handles sending requests and getting responses from the server. Your code
tells the browser what to do, and then the browser takes care of actually
doing it.
The browser just helps out
So now you’re telling me that my code
isn’t
making requests to the server?
That it’s really the web browser doing all
that? I’m so confused...
function getBoardsSold() {
createRequest();
var url = “getUpdatedBoardSales-ajax.php”;
request.open(“GET”, url, true);
request.send(null);
}
Your requests and responses
are handled by the web
browser, not directly by
your JavaScript code.
Why do you think it’s so important that the web
browser handle requests in asynchronous
applications? Remember, a web server can only
respond to whomever made the original request
to that ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

What Employees Want Most in Uncertain Times

What Employees Want Most in Uncertain Times

Kristine W. Powers, Jessica B.B. Diaz
What Successful Project Managers Do

What Successful Project Managers Do

W. Scott Cameron, Jeffrey S. Russell, Edward J. Hoffman, Alexander Laufer
How to Become a Game-Changing Leader

How to Become a Game-Changing Leader

Douglas A. Ready, Alan Mulally

Publisher Resources

ISBN: 0596102259Errata PageSupplemental Content