Hello,

I'm working on an Ajax class - though my question isn't really about Ajax at all..
On line 47 I setup a listener onreadystatechange.
Code:
// Setup listener on readystatechange
this.xhr.onreadystatechange = stateChangeHandler;
The problem is that when Ajax.stateChangeHandler() is called
I have lost a reference to the Ajax object using 'this'
So I am just using Ajax.variable to access it's properties / methods - This works but it feels kind of hacky.

Is there a way to keep the object focus within an event listener?


Thanks,