Из функции contentLoader необходимо вызвать ф-ию loadXMLDoc с параметрами. Как это сделать ?
net = {};
net.contentLoader = function (url, method){
this.xmlHttp = null;
this.url = url;
this.method = method;
this.error_reporting = true;
this.loadXMLDoc.call(this, url, method);//есть null или не является объектом
}
net.contentLoader.prototype = {
loadXMLDoc:function(url, method){
try{
this.xmlHttp = new XMLHttpRequest();
}catch(e){
var xmlHttpVersions = new Array("MSXML2.XMLHTTP.6.0",
"MSXML2.XMLHTTP.5.0",
"MSXML2.XMLHTTP.4.0",
"MSXML2.XMLHTTP.3.0",
"MSXML2.XMLHTTP",
"Microsoft.XMLHTTP");
for(var i=0;i < XMLHttpVersions.length;i++){
try{
this.xmlHttp = new ActiveXObject(XMLHttpVersions[i]);
}catch(e){}
}
}
if(!this.xmlHttp && this.error_reporting)alert("Variable xmlHttp not set !");
else if(!this.xmlHttp)return;
if(this.xmlHttp){
this.xmlHttp.open(method, url, true);
this.xmlHttp.onreadystatechange = function (){
if(this.xmlHttp && (this.xmlHttp.readyState == 4 || this.xmlHttp.readyState == 0)){
document.getElementById("kill").innerHTML = this.xmlHttp.responseText;
}
}
this.xmlHttp.send(null);
}
}
}
window.onload = function (){
net.contentLoader("http://localhost/newphp/a.txt", "GET");
}