$.proxy()
To make sure that this always means this rather than that...
Example from here
MyModule = function() {
this.$div = $('#testdiv');
this.myString = "Hi! I'm an object property!";
this.$div.click($.proxy(this.handleClick, this));
};
MyModule.prototype.handleClick = function() {
console.log(this.myString); // Hi! I'm an object property!
};
var m = new MyModule();