My article describing how to create a simple Javascript XMLHTTP application is now featured on SitePoint. How cool is that!
A bit of history: several months ago I thought SitePoint, my daily read, was missing an intro article on AJAX, so I sat down and wrote one. Meanwhile, while I was preparing it, SitePoint published this excellent AJAX tutorial by Cameron Adams. (Do check this guy's site! He definitely knows his JS!) His article was overlapping mine in the intro part. So I thought it doesn't make sense to have two intro articles and revised mine, basically stripping the intro part and leaving just the second part - the creation of a simple WebConsole application - a web interface for executing shell commands (Try it out here). This second part of the article was published today on SitePoint and I'm quite proud of that fact 😉
Then some time later I saw that DevMo - Mozilla Developers Wiki - started an AJAX section and there was an invitation on it for somebody to write the "Getting Started" article, that was missing at the time. And since I had my intro tutorial lying around, I just published it right there on the Wiki.
So if you're new to the XMLHTTP (AJAX) concept and looking for a place to start:
- Start with the DevMo article, then
- Read through the SitePoint articles - Cameron's and mine, then
- Check the links at the end of the SitePoint article, then/or
- ...just experiment on your own!
BTW, as another real-life example of the reusable JS function for making requests, which is discussed in the SitePoint's article, check this out. It's a little AJAX touch for phpBB, scroll down where it says "Word of the day" and "Mot du jour", click. How is it working? Well, I have a simple PHP script that hits two RSS feeds - Dictionary.com and a French blogger's. My script caches the XML file just not to abuse the RSS feeds with too many requests (not that this site has a lot of requests, but still). So the PHP script basically copies the feeds as two XML files on my server - wotd.xml (as in Word of The Day) and mdj.xml (Mot du Jour).
Steps in JavaScript! When you load the forum's index page nothing special happens. When you click though, an HTTP request is performed, the requested XML file is retrieved, parsed, and the contents we want - displayed. Pretty easy thing to do, using the same JS function for making requests, described in the article.