AJAXコールバックで、myFucntionのalert()が「動作しました」をトリガーするようにしたいのですが、ajaxResponseのmyobjectオブジェクトをどのように参照できますか?オブジェクトをonreadystatechangeに渡す
function myobject(){
this.val="worked";
http.onreadystatechange =function ajaxResponse() {
if (http.readyState == 4) {
this.myFunction();
}
http.send(null);
}
myobject.prototype.myFunction=function(){
alert("it "+this.val);
}
あなたの質問はありますか? – sinsedrix
私の質問はどのようにajaxResponseでthis.valueを呼び出すことができ、これはこのコードを含むオブジェクトの値を参照します。 – user1209203