Internet is growing Every Seconds :: Industry is growing Every Year

Friday, July 15, 2005

AJAX

AJAX

AJAX or Asynchronous JavaScript and XML is a term describing a web development technique for creating interactive web applications.

Ajax incorporates:

* standards-based presentation using XHTML and CSS;
* dynamic display and interaction using the Document Object Model;
* data interchange and manipulation using XML and XSLT;
* asynchronous data retrieval using XMLHttpRequest(The XMLHttpRequest object to interchange and manipulate data asynchronously with the web server (commonly using XML and XSLT although AJAX applications can use other technologies, including preformatted HTML, plain text, JSON and JSON-RPC as alternatives to XML/XSLT));
* and JavaScript binding everything together.




How

1. Web page is rendered
2. A Events executes a JavaScript function call (i.e. onKeyUp, button click, setTimeout, page load, etc.)
3. JavaScript instantiates an XML HTTP object
4. XML HTTP object calls a remote page
5. Remote Page transforms an XML structure using XSLT and returns the result
6. JavaScript accepts the results and applies it to the page
7. No page reload, just magical dynamic data


Ajax Mistakes

Too much code makes the browser slow
Scrolling the page and making me lose my place
Asynchronously performing batch operations
Changing state with links (GET requests)
Breaking the back button