AJAX Example

More examples

A simple AJAX example
Create a simple XMLHttpRequest and then retrieve data from a TXT file.
AJAX Example with Callback Function
Create XMLHttpRequest with a callback function and retrieve data from a TXT file.

Example Explanation

Request XML File

Load XML File Using AJAX
Create XMLHttpRequest to retrieve data from an XML file.
Retrieve Content of XML File
Create XMLHttpRequest to retrieve data from an XML file and then display these data in an HTML table.

Example Explanation

Retrieve Server Data Using PHP and ASP

Retrieve Content of PHP File
How a webpage communicates with a web server when a user types characters in an input field.
Retrieve Content of ASP File
How a webpage communicates with a web server when a user types characters in an input field.

Example Explanation

Retrieve Database Information

Retrieve Content from Database
How a webpage communicates with a web server to read information from a database using AJAX.

Example Explanation