Getting started with AJAX
Introduction
AJAX (Asynchronous JavaScript and XML), in it's simplest form, allows a web page to be updated with information from a web server without refreshing the whole page. For example, you could use AJAX to periodically update a stock price on your website, without constantly reloading the whole page. Instead, a small amount of Javascript code running inside the web browser communicates with a small amount server-side code running on your web server. Typically the information is requested from the javascript with a fairly standard HTTP "GET" request, and returned to the browser from the server in either XML, HTML or raw text.
Points of note
To use AJAX in your website, you need to be able to put executable code or scripts onto your webserver, this can be anything in practically any programming language such as Python, PHP, Perl, or Ruby.
Some web serving services do not permit the use of executable code or scripts on their systems. For example Apple's .Mac does not permit the running of code on it's servers, this means that they cannot be used to host AJAX services.
For security reasons, most web browsers do not allow AJAX code to be used on servers other than the one used to host your web pages. This means that you cannot have the URL http://www.theescapers.com/index.html use code hosted on any other domain than www.theescapers.com. The upshot of this is that although you can use the example AJAX code supplied here in Flux, the examples will not work if you publish your website.
Getting started
To help you get started, The Escapers has hosted a few simple scripts on our web server which you can use to hone your AJAX skills without the need to run your own webserver. The simplest script we have on our server simply returns the date, and this is hosted at the following URL:
http://www.theescapers.com/ajax_examples/simple.php
Clearly, this is a not a very useful script, but will simply demonstrate how to retrieve information from a web server and use it in your web page.