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



All in all, this took me about an hour, including a bit of Javascript debugging and typo-correcting. I was pleasantly surprised at how straightforward it was to set up.

Further abstraction is up to you. I could add a value to pass to getData() to tell it which document element to insert in to; I'd do this if I was thinking about using this technique elsewhere. It could be used for periodic autosaves or similar functionality, though I'm not sure how much faith I have in using AJAX for SQL INSERTs or UPDATEs. Time will tell.

There are a lot of mixed views about AJAX usage. Certainly, I feel that nobody should be excluded from any web functionality simply because they have Javascript disabled, but that seems to be the way the web is moving. And with techniques like this, you'll be ready for it.

Page: