I am a little confused as to what happens when I call the following code:
goog.net.XhrIo.send("/welcome", goog.bind(this.handleWelcome, this));
I have a function with this signature:
myproject.MyClass.prototype.handleWelcome = function(response)
Before I was bound, the handleWelcome context did not have access to the instance fields of my Javascript myproject.MyClass (understandable). Following the information here , I now have a class instance context. All is well and good.
What was the context of "this" before I made the change?
I apologize for any non-Javascript idioms that I use - I am much more familiar with Java and probably use hodgepedia terms.
EDIT
At first, I had some questions about which argument was passed to the callback (in this case, an event with an object like goog.net.Xhrio), but the main question was bind, so I deleted the tangential q.
source share