You are on page 1of 19

AJAX

AJAX

 AJAX : Asynchronous JavaScript and XML.


 It is a technique used for creating fast and
dynamic web pages.
 Ajax allows web pages to be updated
asynchronously by exchanging small amount
of data with the servers behind the scenes.
What is Asynchronous ?

 In AJAX, Asynchronous means that the code does


not executes with loading of page but it executes
when an event occurs.
 The event may be load, click, index of combo-box
change etc.
What is JavaScript And XML ?
 JavaScript is the scripting language that nearly
all browsers support, which will let you fetch
data behind the scenes.

 XML is the popular language that lets you


store data in an easy format.
HISTORY
 The term "Ajax" was coined in 2005 by
Jesse James Garrett.
 Asynchronous loading of content first became
practical when Java applets were introduced in the
first version of the Java language in 1995.
 The utility of background HTTP requests to the server
and asynchronous web technologies remained fairly
obscure until it started appearing in full scale online
applications such as Outlook Web Access,(2000) and
later, notably Google made a wide deployment of
Ajax with Gmail (2004) and Google Maps (2005).[7]
Technologies

AJAX is based on internet standards, and uses a


combination of:

 HTML or XHTML and CSS for presentation


 the Document Object Model for dynamic display of
and interaction with data
 XML for the interchange of data.
 the XMLHttpRequest object for asynchronous
communication .
 JavaScript to bring these technologies together .
How AJAX works ?
 In Browser we write code in JavaScript that can fetch
data from server as needed.

 JavaScript uses the XMLHttpRequest object, to send


a request to the server behind the scenes — without
causing a page refresh.

 The data that comes back from the server can be


XML or just plain text if you prefer
EXAMPLES
 Now we have AJAX enabled Yahoo! Search
where there will be no refresh in page
anywhere and can get search results in same
page.

 Just click on “search Yahoo!” button and you


will get results in same page.
GOOGLE MAPS
 Google maps is a great example of the advantages of
AJAX.
 You can move the mapped area and zoom in and out
on a map (or satellite picture)without refreshing the
page. Because of this, it feels much more responsive
and enjoyable to use than most mapping sites, where
you need to wait for a new page to load to see the
result of, for example,zooming in.
Login Forms

Instead of going to a login page, and then navigating back to the page you
originally wanted, with AJAX, a user can type in their user name and
password directly into the original page
CHAT ROOMS
ADVANTAGES
 Form Validation
Form validation should be instant, seemless and
unobtrusive. AJAX gives you all of that, and more.
 User Simplicity
With ajax we can simply load the content on
the same page.
 Page Load
Entire page need not to be refreshed.

 Speed
AJAX makes changing content fast and simple, and it looks
awesome.

 Backend Bliss
Particularly bad processing or processing happening on a slow
server--results in about 60% of pageload problem
DRAWBACKS
 Owing to their dynamic nature, Ajax interfaces are
often harder to develop when compared to static pages.
 Pages dynamically created using successive Ajax
requests do not automatically register themselves with
the browser's history engine, so clicking the browser's
"back" button may not return the user to an earlier state
of the Ajax-enabled page
 Any user whose browser does not support JavaScript
or XMLHttpRequest, or simply has this functionality
disabled, will not be able to properly use pages which
depend on Ajax.
CONCLUSION
AJAX is a very innovative, fast, modern, outstanding
technology for web pages which can provide rich user
interface and can work almost like a desktop
application.

You might also like