Non riesco assolutamente a capire perchè non si imposta...a rigor di logica dovrebbe funzionare, ma dice che "obj" has no properties...
codice:
function tmp() {
this.obj=new XMLHttpRequest();
this.cp=function () {
if (this.obj.readyState==0) {//Uninitialized
//
}
if (this.obj.readyState==1) {//Loading
document.getElementById("mypage").innerHTML="Loading...";
}
if (this.obj.readyState==2) {//Loaded
//
}
if (this.obj.readyState==3) {//Interactive
//
}
if (this.obj.readyState==4) {//Complete
document.getElementById("mypage").innerHTML=this.obj.responseText;
}
}
}
var k=new tmp();
k.obj.onreadystatechange=k.cp;
try {
k.obj.open("GET","read.xml",true);
k.obj.send(null);
} catch(e) {
alert("Problems in loading the page");
}