These unknown intrepid developers knew immediately that the XMLHttpRequest object was a solution in search of a problem. The only real question was in finding the problem. And although I can't speak for anyone else, the problem that I chose was a shopping cart application described in Chapter 2, "Introducing Ajax." Remember the "mockup" that wasn't a mockup and didn't "blink"? After that particular incident, I was considerably more careful in my selection of applicationsor, at least, in my selection of attendees at my demonstrations.
In fact, at times I was so careful in selecting where to use the XMLHttpRequest object that it was necessary to examine the code to see exactly how it worked. I started by choosing applications in which it appeared that the information was cached on the client side: the dreaded HTML select whose contents are based upon another HTML select, which, in turn, is based upon another HTML select. As long as nobody ever looked at the code, which nobody ever did, the web page wouldn't appear any different from the hundreds of others in the system. That is, it wouldn't appear different unless you take into account speed. Without all the cached information, the initial load was considerably faster.
In retrospect, looking back upon several of those "mad scientist" applications, I realize now that not all of them could be considered Ajax. This is because Ajax is shorthand for Asynchronous JavaScript and XML, and some of these applications were coded to be synchronous. And whoever heard of Sjax?
Nevertheless, because the XMLHttpRequest object can be used both synchronously and asynchronously, both are covered. Moreover, we cover the following topics in this chapter:
Synchronous
Asynchronous
Microsoft Internet Explorer
XML Document Object Model
RSS
Web Services



0 comments:
Post a Comment