Results 1 to 13 of 13
Aug 9, 2007, 06:16 #1
- Join Date
- Jul 2006
- Victoria, Australia
- 28 Post(s)
- 2 Thread(s)
Losing 'this' focus in event listener
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.
// Setup listener on readystatechange this.xhr.onreadystatechange = stateChangeHandler;
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?