Demonstrating xajax
Below you will find four demonstrations of various AJAX techniques using PHP and the xajax library. These demonstrations were part of my lecture at the Eduvision PHP conference
- Requesting the time from the server
- By clicking a button some time information is requested from the server. After the information has been received by the browser a HTML element's content is updated without refreshing the browser.
- Real-time server-side form validation
- While the user is typing a form is validated on the server in real-time.
- Submitting form data without refreshing the browser.
- The data from a form is being sent to the server without the need for a browser refresh. This example also demonstrates it's quite easy to implement Ajax techniques that still work even if the user doesn't have javascript enabled. In this case it simply falls back to a normal form submit with a refresh.
- 'Live Search'
- A complete example of a search box offering suggestions and auto-complete while the user is typing.
All examples by Marco van Hylckama Vlieg. All code is public domain and may be (re)used for all purposes.
Ajax links
- xajax library for PHP, used in these examples.
- Prototype.js, A powerful javascript library forAjax applications
- Unofficial (but very good) documentation for Prototype.js
- Ajaxian blog, The best weblog on the net discussing everything Ajax
- Backbase, Dutch gurus on Ajax. Make sure you check out the free Backbase Community Edition!