Ajax - PowerPoint PPT Presentation

Slide1 l.jpg
Download
1 / 13

Its a web-technology, which speeds up web applications

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

Download Presentation

ajax

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Slide1 l.jpg

AJAX

Bharath. P Information Science dept.

Sapthagiri college of engineering


Agenda l.jpg

Agenda

  • What is AJAX?

  • Overview

  • History

  • How it works?

  • Request phase implementation

  • Response phase implementation

  • Examples of Request and Response phase

  • Advantages and Disadvantages


What is ajax l.jpg

What is AJAX?

  • Asynchronous Javascript and XML.

  • It is a client-side technology that combines a set of known technologies in order to create faster and more user friendly web pages.

  • It provides responsiveness approaching to that of desktop applications.


Overview l.jpg

Overview

  • AJAX is meant to speed web apps that have frequent user interactions.

  • Technologies used mainly are javascirpt, xml, DOM, css…

  • It shortens the required time for both document transmission and document rendering.

  • When browser requests a new part of its displayed document from the server, it doesn’t lock up waiting for response, thus its Asynchronous.


History l.jpg

History

  • Use of <iframe> element which is made invisible by setting width and height to zero, although this worked, it was not elegant.

  • Microsoft introduced 2 extensions to DOM with XmlDocument and XmlHtml (XmlHttpRequest) objects.

  • It got popular from 2005/06 with google maps and gmail popularizing it.


How it works l.jpg

How it works?


Request phase implementation l.jpg

Request phase implementation

  • Object declaration of type XmlHttpRequest.

  • Registering function that implements the receive phase of the application using onreadystatechange property.

  • Call to open method to set parameters (Http method, URL of response document on the server, Asynchronous or synchronous) for HttpRequest.

  • Call to send method to send the HttpRequest to server.


Response phase implementation l.jpg

Response phase implementation

  • Check value of callback from server to see whether processing of request is completed.

  • Get the response using responsetext property of XmlHttprequest object.

  • Display the output in a desired way.


Example of request phase l.jpg

Example of Request phase

  • Varxhr= new XmlHttpRequest();

    xhr.onreadystatechange= response;

    xhr.open(“GET”, “reply.php?....”,true);

    xhr.send(null);


Example of response phase l.jpg

Example of Response phase

  • Function response()

    {

    if(xhr.readystate == 4) {

    var result=xhr.responsetext;

    // any desired code

    }


Advantages l.jpg

Advantages

  • Independent of server technology.

  • Apart from obtaining the XMLHTTP object, all processing is same for all browser types, because Javascript is used.

  • Permits the development of faster and more interactive desktop like interface to users.


Disadvantages l.jpg

Disadvantages

  • The back button problem. People think that when they press back button, they will return to the last change they made, but in AJAX this does not hold.

  • Requests ActiveX to be enabled in IE 5 and 6Is only available in newer versions of Opera, firefox and Safari

  • Has small implementation differences between browsers


Thank you l.jpg

Thank you


  • Login