<%@ LANGUAGE = JScript%> <%drawHeader()%>

Using the AJAX Model

Understanding the toolkit.

Javascript and Document Object Model(DOM)

Hopefully you already have a rudimentary understanding of what javascript is and the some sort of working knowledge of the DOM. In essence they are the language and tools that allow web developers to interact with the browser. There are many resources available on the web on the subject, I'd particularly recommend Mozilla and the W3C. Unfortunately the time allotted for this course is not sufficient to cover this subject in depth. We'll work specifically with the DOM in later examples.

XMLHttpRequest

This is the object to get excited about. In reality it has spawned the technology that is now considered "AJAX". So what makes it so special?

First of all it's the first real asynchronous tool in the javascripters toolbox. Previously asynchronous attempts had to be accomplished via hidden elements and requests. All of sudden the ability to go off and ask for data has been conveniently packaged up for us. Because it was written to work so specifically with scripting it has really enabled the response side of the data retrieval to be custom per application and easily configurable. Often overlooked is the fact that it is readily documented which was never been the case when trying to thread request through hidden frames or some other old school sorcery.

So now we have a great tool to thread data requests with. We'll get more into the specifics of this tool later in this lecture.

XML and Serialized Data

Now that we have a good way to retrieve the data we need a good way to "flatten" it. Largely speaking the data behind the web can be traced back to relational databeses. It's what makes the data effective to get at and creates efficiencies. So in many cases the data must be flattened into some schema your application can understand. Really this is where standards end, and intuition is free to optimize.

In essence there are two emerging schools of thought on how to implement "serialized data". The first school of thought is that the resulting serialization should be rich and stringent. That is to say elements should be strictly typed and defined against a standard. In fact the W3C has defined and released such a standard called XML. The other school of thought is that data serialization should be customized and optimized to suit the applications needs. Usually this is done for performance gains. Well cover this subject more in depth later.

<< BackNext >>
<%drawFooter()%>