Is there a way to make the AJAX callback trigger the alert() function within myFunction and display "It worked"? How can I reference the myobject object as 'this' in ajaxResponse?
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);
}