Joe D Williams wrote:
> So from what I can see, this should cover reasonable possiblilities?
> // create XMLHttpRequest request
> function createXMLHttpRequest()
> ...
I use this, which seems a little more robust:
/**
* Returns an XMLHttpRequest object, either as a core object or an ActiveX
* implementation. If an object cannot be instantiated, it will return null;
* @returns {Object} An XMLHttpRequest object
*/
AjaxRequest.getXmlHttpRequest = function() {
if (window.XMLHttpRequest) {
return new XMLHttpRequest();
}
else if (window.ActiveXObject) {
// Based on
http://jibbering.com/2002/4/httprequest.html
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
try {
return new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
return new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
return null;
}
}
@end @*/
}
else {
return null;
}
};
--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com