Home » General Discussion

What exactly is Ajax?

21 August 2008 | 3,389 views | 2 Comments

Ajax lets Web developers create interactive Web sites that function more like desktop programs rather than static Web sites. Gmail and Google Maps are two of the most common examples of sites built using Ajax. A variety of techniques allow Ajax to place the interactivity directly within the browser, instead of the browser having to constantly contact a Web server to get information.

When someone visits an Ajax site, the browser loads the HTML page as it would normally. After that, though, Ajax uses JavaScript for interactivity. When a site visitor makes a request for more information — for example, to fetch a map — the JavaScript makes the request. The JavaScript doesn’t make a request for information directly to a Web site, though — instead, it uses an API called XMLHttpRequest to transfer the data back and forth. (The data requested is usually in XML format, although it doesn’t have to be.) This allows the Web page and JavaScript to continue to interact with the user, while the XMLHttpRequest handles communications with the server.

JavaScript takes the information handed to it by the XMLHttpRequest, and then uses it or displays it. But only the portion of the page that needs the information is refreshed. This speeds up the display of information, because the entire page doesn’t have to be changed.

  • Glad to help 😉

  • Guest

    Thank you a whole bunch for putting this up, it answered a lot of my questions