What is AJAX
AJAX is a cool name for a very simple technique: asynchronous server requests. Which is again a complex name to say: possibility after a webpage has been loaded to make requests to the server. The main use is for forms that can submit data to the server and display results without requiring the whole page to be reloaded. This is on one hand quicker, as only key information are transmitted, and not the whole data that did not change, and on the other hands looks more like a normal application (see the demo).
Technically, this is done by using a javascript to make a request to the server - then the server answers to the javascript, and finally the javascript modifies the page to display the results. Therefore AJAX applications have 2 components:
You can see below a simple demo of AJAX. Type some text in the left field. Then click on the button. The AJAX javascript will show you what it is sending to the server. When the server answers, the script will show you the raw answer, and finally will write is in the right field.
Implementing AJAX
AJAX is fully implemented in CSE Display, a PHP object to create webpages available here. However, for those who want "only" the AJAX components without the whole object, the necessary elements can be downloaded here.
The elements required for AJAX implementation are:
AJAX is a cool name for a very simple technique: asynchronous server requests. Which is again a complex name to say: possibility after a webpage has been loaded to make requests to the server. The main use is for forms that can submit data to the server and display results without requiring the whole page to be reloaded. This is on one hand quicker, as only key information are transmitted, and not the whole data that did not change, and on the other hands looks more like a normal application (see the demo).
Technically, this is done by using a javascript to make a request to the server - then the server answers to the javascript, and finally the javascript modifies the page to display the results. Therefore AJAX applications have 2 components:
- A client side javascript, and,
- A server side software to answer the requests.
You can see below a simple demo of AJAX. Type some text in the left field. Then click on the button. The AJAX javascript will show you what it is sending to the server. When the server answers, the script will show you the raw answer, and finally will write is in the right field.
Type here and click | Server answers here |
|
Implementing AJAX
AJAX is fully implemented in CSE Display, a PHP object to create webpages available here. However, for those who want "only" the AJAX components without the whole object, the necessary elements can be downloaded here.
The elements required for AJAX implementation are:
- A way to create an event that lauches the request,
- The javascript to react at the event and send the request,
- A server side program to handle the request and send the answer,
- A javascript to interpret the answer and,
- An element on the page that will display the answer.