Skip to content

Instantly share code, notes, and snippets.

@cespare
Created April 14, 2011 22:52
Show Gist options
  • Save cespare/920767 to your computer and use it in GitHub Desktop.
Save cespare/920767 to your computer and use it in GitHub Desktop.
fixed.js
var Foo;
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
Foo = (function() {
function Foo() {}
Foo.prototype.init = function() {
var lalala = this;
$("#submitButton").click(__bind(function(event) {
// throws an error "HTMLDocument element does not have property onSubmitButtonClicked
return this.onSubmitButtonClicked(event);
}, lalala));
};
Foo.prototype.onSubmitButtonClicked = function(event) {}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment