thedigitalfeed.co.uk content
thedigitalfeed.co.uk/Code
AJAX: Nice and Easy
Posted on Tuesday the 24th of January, 2006
www.thedigitalfeed.co.uk/code/2006/01/24/ajax-nice-and-easy
AJAX was the buzzword of last year, and looks to continue to be the Big Thing in 2006, highly touted as an integral part of the 'Web 2.0' framework. Although AJAX is just an old idea with a new name, it's certainly a valuable tool in your arsenal.
I finally succumbed to AJAX yesterday. I had a requirement to integrate a basic help system into a Content Management System that I have written. The help system itself is really just a quick-reference for various options around the administration area. The options were:
Personally, I don't like floating CSS (like tooltips) for anything more than <a> titles or <img> alt tags. I find them a little obtrusive and somewhat ugly, just like pop-up windows. These and Iframes both rely on Javascript to load the content, and loading the help contents based on $_GET variables would mean that clicking on a help link would lose any changes the user has not yet saved.
The only option was to use Javascript in one way or another. The benefits to AJAX are obvious. It's a very quick way to grab a snippet of data from the server and use Javascript to inject it into the page at hand. If I have to use Javascript (something I usually try to avoid) then why not AJAX?
AJAX is a very simple concept. Using values passed to a Javascript function, load a script on the server, passing these values as $_GET variables. When a response from the server arrives, parse the data and inject it back into the page. So let's get started on the Javascript.
I finally succumbed to AJAX yesterday. I had a requirement to integrate a basic help system into a Content Management System that I have written. The help system itself is really just a quick-reference for various options around the administration area. The options were:
- Floating CSS elements
- Pop-up windows
- Iframe
- Dynamic display based on $_GET variables
- AJAX
Personally, I don't like floating CSS (like tooltips) for anything more than <a> titles or <img> alt tags. I find them a little obtrusive and somewhat ugly, just like pop-up windows. These and Iframes both rely on Javascript to load the content, and loading the help contents based on $_GET variables would mean that clicking on a help link would lose any changes the user has not yet saved.
The only option was to use Javascript in one way or another. The benefits to AJAX are obvious. It's a very quick way to grab a snippet of data from the server and use Javascript to inject it into the page at hand. If I have to use Javascript (something I usually try to avoid) then why not AJAX?
AJAX is a very simple concept. Using values passed to a Javascript function, load a script on the server, passing these values as $_GET variables. When a response from the server arrives, parse the data and inject it back into the page. So let's get started on the Javascript.