XmlHttpRequest - blast from the past or future html

XmlHttpRequest – blast from the past or future

In several places XMLHttpRequest sprung up this week. XmlHttpRequest is a JavaScript object allowing browser clients to communicate with a server without refreshing the current page. This object originated from Microsoft, implemented as an ActiveX object. But other browser including mozilla are also supporting it now. Amis already built an application using this technology way back in 1999. The guys who developed that system have proven to be quite visionary. The way they built is exactly what Duncan Mills describes in his commentary on a TSSS presentation.

the use of XmlHttpRequest to communicate with the server asynchronously in the background, and populating the page by manipulating the DOM tree. So the page can be updated without refreshing the whole page, giving you things like instant validation and really dynamic screens..

They took it even a step further in creating a behavior (htc file) which they attached to HTML tables. In this way the tables act like multi record blocks in Oracle Forms. The table remains in place and only data change, complete with scrolling. Really cool. Changes in data are cached in an XML object clientside until the save button is pressed. The records are then posted to the server again using the XMLHttpRequest. There the posted XML is handled by a generic “XML to Table data converter”.

Now that it has become mainstream I can see a lot of good uses for it. Indeed validation, dynamic screens but also for example coordinated select list and “smart forms” (completion of entered values). An excellent little example and great introductory tutorial on XmlServletRequest can be found here
It shows how based on a zip code, city and state are filled in in the onblur event of the zip code textfield
Javascript is much more powerfull this way, it can call webservice, query a database etcetera. It’s is not tied in with any serverside language. You can use any language you want, PHP,CGI,Java.

Interestingly enough the response to an XmlHttpRequest does not have to be XML …

8 Comments

  1. Marco Gralike August 18, 2005
  2. Lucas March 27, 2005
  3. Greg March 25, 2005
  4. Jim March 9, 2005
  5. Java Utilities March 6, 2005
  6. Jasper March 6, 2005
  7. Ravi March 6, 2005
  8. Lucas March 6, 2005