Code : Tout sélectionner
ObjectAjax.prototype.exReq=function(){
this.methode=function(){
this.value=null;
var readyState = this.readyState;
if (readyState == 4) {
this.value= this.responseText;
alert(this.value);
}
}
this.req.open('GET','ajax.php',true);
this.req.onreadystatechange=this.methode;
var object= new this.methode;
alert(object.value);
this.req.send(null);
}alert(object.value); devrait me renvoyer ma valeur this.responseText; béh non
value n'est même pas reconnu comme une propriété
il y a peut être un soucis au niveau de ces this