Example 1: Simple Content Retrieval

This example retrieves the content of the specified file and displays it to the user along with the status information as it is returned by the XMLHttpRequest object. Two files are provided to illustrate retrieving simple text content and content that is dynamically generated on the server – text.txt and dynamiccontent.php. Requesting any other file name will result in a 404 error.

Contents of File:

 

Status Code:  

Status Text: