Over a million developers have joined DZone.

XMLHttpRequest For IE

·
XMLHttpRequest for IE
 - support onload event handler
 - you can modify "XMLHttpRequest.prototype" for debugging, tracing and AOP style programming.


(function(){
if(typeof ActiveXObject == "function" && typeof XMLHttpRequest == "undefined"){
	XMLHttpRequest = function(){
		var self = this;
		var props = "readyState,responseText,responseXML,status,statusText".split(",");
		this.readyState  = 0;
		this.__request__ = new ActiveXObject("Microsoft.XMLHTTP");
		this.__request__.onreadystatechange = function(){
			for(var i=0;i

you can trace request.open like this.

(function(){
var open_old = XMLHttpRequest.prototype.open;
XMLHttpRequest.prototype.open = function(){
    alert("open called!");
    return open_old.apply(this,arguments)
}
})()
Topics:

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}