Why is context different in these two event handlers
问题 This is a basics question but I cannot figure out why the context ( the 'this' pointer ) is correct in the second event handler and incorrect in the first one. I have this simple constructor function to create the object myNotifier: function Notifier ( message ) { this.message = message; this.saySomething = function () { alert( "I say:" + this.message); } } myNotifier = new Notifier(" HELLO!"); Then I use the myNotifier.saySomething() method as an event handler for CLICK on two buttons: $("