Skip to content

Instantly share code, notes, and snippets.

View cespare's full-sized avatar

Caleb Spare cespare

View GitHub Profile
@cespare
cespare / gist:920767
Created April 14, 2011 22:52
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));