
AJAX can be used for interactive communication with a database. AJAX Database Example The following example will demonstrate how a web page can fetch information from a database with AJAX: Example Select a customer: Alfreds Futterkiste North/South Wolski Zajazd Customer info will be listed here… Try it yourself » Example Explained – The showCustomer() Function [...]
Read More >>

AJAX can be used for interactive communication with an XML file. AJAX XML Example The following example will demonstrate how a web page can fetch information from an XML file with AJAX: Example Get CD info Try it yourself » Example Explained – The stateChange() Function When a user clicks on the “Get CD info” [...]
Read More >>

AJAX is used to create more interactive applications. AJAX ASP/PHP Example The following example will demonstrate how a web page can communicate with a web server while a user type characters in an input field: Example Start typing a name in the input field below: First name: Suggestions: Try it yourself » Example Explained – The [...]
Read More >>

When a request to a server is sent, we want to perform some actions based on the response. The onreadystatechange event is triggered every time the readyState changes. The readyState property holds the status of the XMLHttpRequest. Three important properties of the XMLHttpRequest object: Property Description onreadystatechange Stores a function (or the name of a [...]
Read More >>

Server Response To get the response from a server, use the responseText or responseXML property of the XMLHttpRequest object. Property Description responseText get the response data as a string responseXML get the response data as XML data The responseText Property If the response from the server is not XML, use the responseText property. The [...]
Read More >>

The XMLHttpRequest object is used to exchange data with a server. Send a Request To a Server To send a request to a server, we use the open() and send() methods of the XMLHttpRequest object: xmlhttp.open(“GET”,”ajax_info.txt”,true); xmlhttp.send(); Method Description open(method,url,async) Specifies the type of request, the URL, and if the request should be handled asynchronously [...]
Read More >>

The keystone of AJAX is the XMLHttpRequest object. The XMLHttpRequest Object All modern browsers support the XMLHttpRequest object (IE5 and IE6 uses an ActiveXObject). The XMLHttpRequest object is used to exchange data with a server behind the scenes. This means that it is possible to update parts of a web page, without reloading the whole [...]
Read More >>

To understand how AJAX works, we will create a small AJAX application: Example Let AJAX change this text Change Content Try it yourself » AJAX Example Explained The AJAX application above contains one div section and one button. The div section will be used to display information returned from a server. The button calls a [...]
Read More >>

AJAX is about updating parts of a web page, without reloading the whole page. What You Should Already Know Before you continue you should have a basic understanding of the following: HTML / XHTML CSS JavaScript / DOM If you want to study these subjects first, find the tutorials on our Home page. What is AJAX? [...]
Read More >>

AJAX = Asynchronous JavaScript and XML. AJAX is not a new programming language, but a new way to use existing standards. AJAX is the art of exchanging data with a server, and update parts of a web page – without reloading the whole page. AJAX Example Let AJAX change this text Change Content Try [...]
Read More >>