Simple AJAX Example

Asynchronous JavaScript and XML is a technology that changes the way web pages work by achieving asynchronously exchanges with the server. Web applications, running on a browser, are all subject to call XMLHttpRequest to communicate with the server as well as making use of dynamic HTML, technologies that are the core of Ajax.
The name Ajax was coined by Jesse James Garrett in an article published on the Adaptive Path site in 2005.

* What's Ajax?
* Ajax and data formats.
* Ajax frameworks.
* Resources.
* Beyond Ajax.

What is Ajax?
The technique became popular as soon as the article was published and that has improved greatly the quality of some websites by allowing smooth and innovative applications.

Ajax is a combination of existing technologies to create dynamic Web sites operating just as desktop software:
XMLHttpRequest. - Object of the browser used by JavaScript, it performs GET or POST requests to the server to read a file or send parameters.
JavaScript. Scripting language running server side.
DOM. The Document Object Model is a representation of the structure of an HTML or XML document and allows to access elements in the document.
CSS. Cascading Style Sheets, define the presentation of a page.
XML or other data format. Although the term XML is in the definition of Ajax, the XHR object allows both to read text files or JSON.

Ajax and data formats
The object as defined in the standard specification allow to use two different attributes used when the file is loaded in XML format or not, knowing that a file JSON is seen as a text file. There are responseXML and responseTxt.

Ajax frameworks
Using a framework avoids to the programmer to rewrite common functions of Web applications, they are all available and tested on major browsers.
An Ajax framework when it is pure JavaScript can run on any system, it runs client side. Or it may also have a part running server side, in different programming languages: PHP, Java, ASP.

The Ajax tutorial with sample code.
The easiest AJAX samples. First example shows how to fill actual page with external data without refresh. Second example is the classic no-refresh data acquisition, good for chats and other applications. The samples are very clear and easy to understand. If you like them, PLEASE VOTE!

Contact Me

© Copyright Source Code World | Designed By Code Nirvana
Back To Top