Vous êtes sur la page 1sur 17

What is web browser?

What is web server?


Introdiction

• Ajax is a technique rather than a


technology.it describes how
javascript can be used to pull data
from the server using the XML HTTP
Request object and then insert this
data into the website using DOM.
• This is done Asynchronously(i.e in
the background,without having to
refresh the whole page).
• AJAX (Js+Css+Dom+xmlHttpRequest+
xml)
History
• The first use of the term by JESSE
JAMES GARRETTE in february 2005.
• AJAX was made popular in 2005 by
Google (with Google Suggest).

What is Ajax?
• Asynchronous javascript and xml
• Group of interrelated webdevolopment
techniques used on the client-side to create
better,faster interactive web applications
• (Or)
• Ajax help you in making your web
application more interactiovewithout
refreshing the whole webpage
• i.E whan user submit a request to a
server,serverprocesses the request and
returns the view in new page whach is an
inefficient,time consuming.

What is Ajax
• Synchronous "request/response"
communication model
• "Click, wait, and refresh" user
interaction paradigm:
• Asynchronous communication
replaces "synchronous
request/response model
• "Partial screen update" replaces
the "click, wait, and refresh"
user interaction model.
What is Ajax
What is Ajax
History
• The first use of the term by JESSE
JAMES GARRETTE in february 2005.
• AJAX was made popular in 2005 by
Google (with Google Suggest).


Standards

• AJAX is based on the following web


standards:
– JavaScript
– XML
– HTML
– CSS

• The web standards used in AJAX are well
defined, and supported by all major
browsers. AJAX applications are browser
and platform independent.

Understanding the technology
behind Ajax
• Ajax is not a single technology, but it is a combination
of many technologies. These technologies are
supported by modern web browsers. Following are
techniques used in the Ajax applications.
• JavaScript:
• JavaScript is used to make a request to the web
server.
• Asynchronous Call to the Server:
Most of the Ajax application used the
XMLHttpRequest object to send the request to the
web server.
• XML:
XML may be used to receive the data returned from
the web server. JavaScript can be used to process
the XML data returned from the web server easily.


The XMLHttpRequest Object

• By using the XMLHttpRequest object, a web


developer can update a page with data from the
server after the page has loaded!
• Different browsers use different methods to create the
XMLHttpRequest object.


• var xmlHttp;


• // Firefox, Opera 8.0+, Safari
xmlHttp = new XMLHttpRequest();


• // Internet Explorer
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
• (or)
• xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
More About the
XMLHttpRequest Object

• The onreadystatechange Property


– The onreadystatechange property
stores the function that will process
the response from a server

• xmlHttp.onreadystatechange =
function() {
• //We are going to write some code here
• }
More About the
XMLHttpRequest Object

• The readyState Property



• Here are the possible values for the readyState property:

• State Description

– 0 The request is not initialized


– 1 The request has been set up
– 2 The request has been sent
– 3 The request is in process
– 4 The request is complete

How Ajax Works?

• When user first visits the page, the


Ajax engine is initialized and
loaded. From that point of time user
interacts with Ajax engine to
interact with the web server.
• User Visit to the page:
• Event Processing Loop:
• Initialization of Ajax engine:

Ajax framework
• A framework eases the work of the Ajax
programmer at two levels: on the
client side, it offers JavaScript
functions to send requests to the
server. On the server side, it
processes the requests, searches for
the data, and transmits them to the
browser. Some frameworks are very
elaborate and provide a complete
library to build web applications.
• Ex:SAJAX is a framework for server
sided implementation of the AJAX
Constituent technologies
• XHTML and CSS:For makingup styling
inform
• DOM(document object model):Allows
scripting within web cocument.
• It is not HTML nor is it javascript but
it is something like the glue that
binds them together
• XML:used represent data as a
standerd format
• XSL:Extensible stylesheet language
is a way to add styles to XML.