In this case, you??™re using the JSON library to parse the
response and turn it into a JavaScript object.
With all the pieces in place, it??™s time to send out the request:
var ajax = new Ajax();
ajax.send('/path/to/script', {callback:processRequest});
I specified the URL that I want to call and specified the callback option, assigning to it the
processRequest() function. I didn??™t specify the method because it automatically defaults to GET.
CHAPTER 5 n AJAX AND DATA EXCHANGE 118
What Do All the Different ActiveX Objects Mean?
If you??™ve scoured through any number of Ajax solutions, you might have noticed different
XMLHttpRequest objects being referred to. Microsoft??™s XML implementation, which is known
as MSXML, comes in many versions.
Here??™s the list:
??? Microsoft.XMLHTTP
??? Msxml2.XMLHTTP
??? Msxml2.XMLHTTP.3.0
??? Msxml2.XMLHTTP.4.0
??? Msxml2.XMLHTTP.5.0
??? Msxml2.XMLHTTP.6.0
An article from the Microsoft XML team explains in some detail the differences between
the different versions and how they should be used (but it??™s still not entirely clear: http://
blogs.msdn.com/xmlteam/archive/2006/10/23/using-the-right-version-of-msxml-ininternet-
explorer.aspx).
MSXML 1.0 and 2.0 are no longer supported byMicrosoft. Version 4.0 never saw an operating
system release, and version 5.0 was a special version for Microsoft Office. The versionindependent
IDs, Microsoft.XMLHTTP and Msxml2.
Pages:
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186