 <p>Classic closure problem. When you get the callback, the closure actually refers already to the HTTP object.</p> <p>You can do the following as someone suggests:</p> <pre><code>var that = this; this.req.onreadystatechange = function() { this.handleReceive.apply(that, []); }; </code></pre> <p>OR just do the following:</p> <pre><code>var that = this; this.req.onreadystatechange = function() { that.handleReceive(); }; </code></pre>