Ho fatto un piccolo update al codice javascript...uso questo:
adesso ci sono quasi...il problema è che si ferma a readyState 0(uninitialized)
Codice PHP:
function lib_xml_initialize() {
//Properties
this.obj=null;
this.Loading="Loading...";
this.Writer="mypage";
//Methods
this.Page=function () {
alert("pagina"+this.obj.readyState);
if (this.obj.readyState==0) {//Uninitialized
//
}
if (this.obj.readyState==1) {//Loading
document.getElementById(this.Writer).innerHTML=this.Loading;
}
if (this.obj.readyState==2) {//Loaded
//
}
if (this.obj.readyState==3) {//Interactive
//
}
if (this.obj.readyState==4) {//Complete
document.getElementById(this.Writer).innerHTML=this.obj.responseText;
}
}
this.AdvancedLoad=function (tipo,surl,async,tosend,user,pass) {
if (this.obj==null) {
alert("Your browser doesn't support XMLHTTP");
return false;
}
try {
alert("lol");
this.obj.open(tipo,surl,async,user,pass);
this.obj.send(tosend);
return true;
} catch(e) {
alert("Problems in loading the page");
return false;
}
return true;
}
this.Load=function (tipo,surl,async,tosend) {
if (this.obj==null) {
alert("Your browser doesn't support XMLHTTP");
return false;
}
try {
alert("lol");
this.obj.open(tipo,surl,async);
this.obj.send(tosend);
return true;
} catch(e) {
alert("Problems in loading the page");
return false;
}
return true;
}
this.EasyLoad=function (surl) {
return this.Load("GET",surl,true,null);
}
try {
// Firefox, Opera 8.0+, Safari
this.obj=new XMLHttpRequest();
} catch (e) {
// Internet Explorer
try {
this.obj=new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
this.obj=new ActiveXObject("Microsoft.XMLHTTP");
}
}
//Events
this.obj.onreadystatechange=this.Page();
}