Make a Ajax powered Web site in ten minutes
We have been toying around with AJAX apps and XMLHttpRequest but have wanted to put up a site that loads all of its content asynchronously. If you’re like us and you learn best from working with examples you’re only 10 minutes away from your first AJAX website.
Angus Turnbull of Twinhelix has written an interesting piece of code named, “HTMLHttpRequest v1.0beta2” and it′s the perfect start to building your own rich client-side web applications that send and retrieve data to/from a server.
I have done several examples and tutorials on this subject, but this is one of the most complete I′ve seen to date. As stated by Angus the methods used also have several advantages:
Browser Support
This implements both XMLHttpRequest and a custom-written hidden-IFRAME-based transport layer. Therefore, it works in a wider range of browsers, including Opera 7 and IE5/Mac.
Accessibility
The document interface code is written with modern “best practice” coding standards in mind. Links are standard A HREF links with a CLASS attribute applied, so legacy useragents can still access your site′s content.
Multithreading
The threaded RemoteFileLoader object will automatically create transports as needed, so you can have as many simultaneous requests going on in the background as you want. Plus, it′s smart enough to reuse transports that are idle or loading into the same target.
Easy
You can load any file anywhere with just a function call.
So the question is how do I create a website in less than ten minutes Max? Simple, first take a look at Angus′s wonderful demo page and play around for a few minutes. When you′re done being amazed, download the example.
Script License Agreement
HTMLHttpRequest v1.0beta (c) 2001-2005 Angus Turnbull, TwinHelix Designs
Licensed under the CC-GNU LGPL, version 2.1 or later
This is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Open the content folder in your favorite text editor and use any of the pages as an example for your content pages. Next, fill body with your content - for now use text only. Open htmlhttprequest.html and delete everything except example 1. Change the li′s to your links in ul id="demoLinkList". Upload the pages to your favorite directory. That′s it, you′ve done it! You′ve just made an AJAX website that loads all of its content asynchronously, in less than 10 minutes.
Popularity: 3% [?]


on April 27th, 2008 at 2:20 pm
excellent !!