Thursday, June 8th, 2006

The Ajax Transport Method(s)

Category: Ajax, Programming, XmlHttpRequest

The IBM developerWorks site has this new tutorial posted today, a look a the various “Ajax transport methods” – XMLHttpRequest, IFrames, and script tags – what they are, how to use them, and which is best for what situation.

Discover three Ajax data transport mechanisms (XMLHttp, script tags, and frames or iframes) and their relative strengths and weaknesses. This tutorial provides code for both the server side and the client side and explains it in detail to provide the techniques you need to put efficient Ajax controls anywhere you need them.

In addition to understanding how the client requests data from the server, you’ll also learn how to transport different data types. In addition to Extensible Markup Language (XML), you can move plain text, Hypertext Markup Language (HTML) pages, or JavaScript code.

You’ll either need to register to get to the actual tutorial or you can check out the PDF version of it directly. They start with creating the database foundation for the backend, including the PHP code that you’ll need to interface with it (the code is available for direct download as well). They also create the backend interface, various types of services – plain-text, XML, RSS, RDF, and JSON.

From then on, they construct the clients to interface with those backends, first with XMLHttpRequest, then an iframe, finally the Javascript “script” tag. For each, they make a an example call to the backend(s) retrieving information of various books in the created table (author, title, ID number).

Posted by Chris Cornutt at 7:06 am

3.7 rating from 46 votes


Comments feed TrackBack URI

A very good insight on other transport mechanisms used in AJAX!!
But not able to download code through the link.

Comment by Shailendra — June 8, 2006

I used XMLHttpRequest only in my Ajax framework – jsLINB. We support modern browsers.

Comment by linb — June 8, 2006

linb… it’s not a matter of just supporting modern browsers…

js-ondemand script insertion as an AJAX transport mechanism is very often much faster than the XHR object and it doesn’t carry any memory overhead. And iFrames are handy for file uploading and portable (albeit not entirely ideal) comet simulation…

Any good AJAX framework should support all 3 transports, it’s very easy to do so in an abstracted manner.

Comment by Ryan Gahl — June 8, 2006

…also, forgot, script tags allow cross-domain communications whereas XHR does not.

Comment by Ryan Gahl — June 8, 2006

[…] Ajaxian » The Ajax Transport Method(s) (tags: ajax transport) […]

Pingback by links for 2006-06-09 at /dev/caffeine — June 8, 2006

I’ve published the wiki notes for my Ajax Transport Layer Alternatives presentation from the Ajax Experience at
and I’ve got a related blog entry at

Comment by Brent Ashley — June 9, 2006

[…] Ajaxian » The Ajax Transport Method(s) […]

Pingback by Deep Codes » AJAX Transport Methods — June 10, 2006

That PDF link is dead … could somebody post an alternative link?

Comment by drx — June 11, 2006

hey this PDF is Intresting..Cheers 2 Jack Herrington

Comment by riax — June 29, 2006

Leave a comment

You must be logged in to post a comment.