Web Development with jQuery®

(Elliott) #1

AJAX


AJAX is the technology that enables you to make arbitrary HTTP requests from JavaScript to
obtain new data without the need for reloading a document. AJAX stands for Asynchronous
JavaScript and XML. The name is misleading, though, because you don’t have to use XML,
and your requests don’t have to be asynchronous. You can have synchronous requests (a
request that causes your code to pause execution until the answer is received from the server)
that are in the JSON format. XML is just one of many possible formats that you can use to
transmit data from a server to client-side JavaScript.

Using AJAX you can make web documents behave much less like documents and much more
like completely self-contained desktop applications. With a web-based application, updates are
much easier to propagate because everyone upgrades immediately upon their next visit to the
website. No longer do companies worry about maintaining legacy software and users—with
a web-based application, everyone is pushed to the latest version. It also becomes easier for a
user to access these applications. Because a separate installation is not required on every com-
puter where the application’s use is wanted, all that is required is a capable browser on top of
moderately capable hardware. Browsers strive to blur the line between desktop applications
and web-based applications even more because browsers such as Firefox and Google’s Chrome
browser make it easier to make a web-based application available as a desktop application via
placing an icon on the user’s desktop, dock, start menu, or quick-launch bar. In Firefox’s case,
this functionality is experimental, but in the case of Chrome, the feature is already a reality.
Then there is Adobe’s AIR runtime, which allows you to develop desktop applications using
web standards. Because AIR is built on top of WebKit—which is the rendering engine used in
Safari, and iOS, among others—AIR can make sophisticated, complex desktop applications
using a robust standards-compliant rendering engine. So, if these companies have anything to
say about it, web-based applications will become more popular and increasingly take over cer-
tain tasks that desktop applications once served.

Another advantage of web-based application development, which some people may perceive
as nefarious, is that web-based applications are immune to piracy, at least in the traditional
sense. It’s impossible to obtain a web-based application’s services without payment because a
user can simply be locked out if payment is not made, and use of an application can be limited
to a single login session at a time. Up until now, this aspect hasn’t been much of a problem,

7


http://www.it-ebooks.info

Free download pdf