is a new approach to web applications. Though AJAX has been around for
the last eight years, web developers didn't notice this technology
until recently when Google used it for its Gmail, Google Maps etc. AJAX
has emerged as a powerful platform for creating rich, web based
applications that look and work like desktop applications even though
they are browser based and use few resources.
term AJAX was coined by Jesse James Garrett. This term was introduced
to describe a set of technologies that allow browsers to provide users
with a more natural browsing experience.
is not a technology but it is a methodology which you can use to build
more dynamic and responsive web applications. According to Jesse James
Garrett, AJAX combines several technologies, each thriving in its own
right, and coming together in new and powerful ways.
Here are the technologies that AJAX combines to give customers its distinctively different, wonderful and magical results:
- HTML or XHTML as mark up language and CSS for creating style guide
to dynamically display and interact with the information presented
- XML and XSLT for data interchange and manipulation. XML is the commonly used format for transferring data back from the server
- XMLHttpRequest object to exchange data asynchronously with the web server
Why should I use AJAX?
is an outstanding approach, and it looks to only become more prevalent as time goes by. Let us go
through the reasons behind the growing popularity of AJAX:
is an open standards-based technology, which means that it supports most browsers
and platforms. This means you will never have the uncertainty whether or not
your application will run on your user's machine.
- AJAX-based applications are more usable and provide better user experience.
Pages can request small bits of information from the server instead
of requesting whole pages. This eliminates the problem of refreshing pages and slow
- AJAX benefits everyone, from the developers to the end-users. With
AJAX, your web applications can enjoy a number of benefits, such as lower
cost of deployment, easier support, shorter development times and fewer installation hazards.
is easy to learn and master, so there is no steep learning curve for
development teams to shift from simple HTML and form-based applications
to rich AJAX-based applications. It is very easy to upgrade the
interface of existing application using AJAX; it doesn't require a
wholesale upgrade and rewrite of present applications.
is compatible with any standard web server and server-side
language. You may take your pick from PHP, ASP, Perl, or
ColdFusion and start building your web application.
all know that the Web 2.0 movement is in full swing; it is helping AJAX
adoption for the time being. AJAX interfaces are key components for
many Web 2.0 applications like Google maps or BackPack.
It should be noted, however, that there are some drawbacks to AJAX. For example, AJAX might easily break the expected behavior of browser's back button. Users might expect that clicking on back button will take them to the previous page, however it might not always happen for AJAX.
not index any of the dynamically generated content. Therefore, AJAX
websites are not SEO friendly.
How does AJAX work?
you have used Gmail or Google maps, you must have noticed that you can
check spelling of typed text or can scroll over the map respectively
without submitting the page. AJAX is behind this behavior â€“ it handles
server side operations that provide the desired results. Gone are the
older approaches, which require reloading or refreshing of entire page
with every request.Â AJAX makes requests to the server without
reloading the page. It provides the ability to communicate with the
server asynchronously. So, no more waiting for the entire page to load
since page information or user interface gets loaded/updated instantly.
The interesting thing about this is - users donâ€™t even realize that
the page code is communicating with the server; they feel it like
is an AJAX engine that works as a mediator between the user and the
server. Instead of loading a web page at the start of the session, the
renders the interface to the user and communicates with the server on
behalf of the users. It is the engine that is responsible for
asynchronous interaction between user and application, without letting
the users know what communication is going with the server.
may dynamically change the URL of the source without using a page
refresh. This XMLHTTPRequest object retrieves information from the
server in similar invisible way and it seems that page has been
refreshed. However, any response to a user action that doesnâ€™t require
a response from server is managed by the engine. It can be simple data
validation, editing data in memory or even some navigation.Â Â
How is AJAX coded?
code an AJAX application, firstly, you need to know how to create
var xmlHttp=new XMLHttprequest();
The process differs based on the type of web browser you are using.
With Internet Explorer, the request looks like:
http = newActiveXObject(â€œMicrosoft.XMLHTTPâ€);
Â Whereas in a standards-compliant browser, you can initiate the object directly:
Â http = new XMLHTTPRequest();
XMLHTTPRequest object handles all your server communication and it is
In normal application, if you fill up a form and click on Submit
button, the entire form is sent to server, the server then works on
processing a script. When the script is done, a completely new page is
loaded. Of course during this time â€“ when the server is processing the
page and a new page is getting loaded â€“ the user has to wait. They
get a blank page and then a page that is redrawn from the server.
technology and XMLHttpRequest object between the userâ€™s web form and
the server. When some data is given in the form and sent, it is sent to
the server. When this thing happens, userâ€™s screen doesnâ€™t become
blank. It doesnâ€™t even get a flash or blink. So the user can continue
entering data, scrolling around and using the application.Â Â Â
Who is using AJAX?
you have used any of these Googleâ€™s latest products â€“ Gmail, Orkut,
Google Groups, Google Suggest, Google Maps â€“ you have already
experienced AJAX based applications. However, there are many more
websites that are not too far behind Google. Amazonâ€™s A9.com search
engine is applying AJAX and many of the features of Flickr depend on
above examples make it clear that AJAX is not only technically sound,
but also quite practical for developing real-world application. The AJAX
applications can be of any size and type â€“ from the very simple
Google Suggest to much complex Google Maps â€“ AJAX is fit to build any
AJAX is also used by some of the worldâ€™s popular applications such as:
- Ask.com search engine
- BaseCamp project management service
- Jacuba.com spell checker
- Meebo instant messenger
- MSN Virtual Earth
- Yahoo Instant search
AJAX and browser compatibility
AJAX is a simple technology and today most of the browsers support it. Here are some of them:
- Microsoft Internet Explorer 5.0 and above
- Mozilla, Mozilla Firefox, SeaMonkey, Camino, Flock, Epiphany, Galeon, and Netscape 7.1 and above
- Opera browser version 8.0 and above
- Apple Safari version 1.2 and above
there are some browsers that do not support AJAX. They are: Opera 7 and
below, Microsoft Internet Explorer 4.0 and below, Lynx and Links.