- Here is the group chat page, a very simple Ajax example.
- The chat page: [ Group Chat Source ]
- The supporting PHP script: [ Message Collector Source ]
- Things to note.
- The page is updated by Javascript: it is not reloaded.
- But it does get information from the server: Javascript uses an
an HTML request using the XMLHttpRequest Javascript object.
- Starts the request.
- Arrival of a response is an event that must be handled later.
- The HTTP request is handled by a specialized PHP script.
- The script does not return an HTML page, but either plain text, or
JSON.
- The response is consumed by the javascript, not parsed by the
browser.