Subject: newbie question
Posted By: pbb Post Date: 9/26/2006 5:47:58 AM
Hi all,

I've got the following code, which results in an error "object doesn't support this property or method" on the this.onready() line:


function Foo() {
    this.site = "http://www.google.com";
    this.onready = function(text) {
        alert(text);
        // do response processing here
    }
    var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    xmlhttp.open("GET", this.site, true);
    xmlhttp.onreadystatechange = function() { 
        if (xmlhttp.readyState == 4) {
            var text = xmlhttp.responseBody;
            this.onready(text);
            // Object doesn't support this property or method
        }
    }
    xmlhttp.send();
}

objFoo = new Foo();


Basically what I want to do is create an object that contains all information for the XHR, including processing functionality. What am I doing wrong?

Thanks, Peter

Go to topic 50105

Return to index page 165
Return to index page 164
Return to index page 163
Return to index page 162
Return to index page 161
Return to index page 160
Return to index page 159
Return to index page 158
Return to index page 157
Return to index page 156