AJAX is a technology or technique for web browsers to communicate with servers not a programming language.
It refers to JavaScript's capability to use a built-in object, XMLHttpRequest, to communicate with a server without submitting a form or loading a page.
The name is a missnomer because XML is not required. AJAX can retrieve text, HTML, XML and JSON (Java Object Notation) files and can communicate with server-side scripts/programs like CGI, but without refreshing the web page.
Asynchronous means that javascript code or page rendering can continue without waiting for the response from the server.
When the response arrives from the server, a JavaScript function is tirggered to act on the data.

Google, Amazon, Facebook and many social networking sites use AJAX.
It is used by most of the big web sites.

Google's Gmail mail client uses AJAX to make a fast-responding email application. You can delete messages and perform other tasks without waiting for a new page to load.

Amazon uses AJAX for some functions. For example, if you click on one of the Yes/No voting buttons for product comment, it sends your vote to the server and a message appears next to the button thanking you, all without loading a page.

Facebook or any site allowing you to "like" something, is probably the most prevalent use of AJAX. Every time you click to "like" something, you are using AJAX to communicate that click to a server-side script, which updates the like indication.

AJAX was developed by Microsoft, but you do not need Microsofts ASP (active Server Pages). It runs fine on servers running on Linux.

Code looks like this:

ajaxreq = new XMLHttpRequest();
ajaxreq.open("GET", "search.php?query=John") ;
...
ajaxreq.onreadystatechange = ajaxResponse ;
ajaxreq.send(null) ;

function ajaxResponse() {
if (xhttp.readyState == 4 && xhttp.status == 200) {
      myFunction(xhttp);
    }
Links:
AJAX examples.
Search for AJAX.

last updated 15 May 2016