Skip to content

Instantly share code, notes, and snippets.

@singerxt
Last active August 29, 2015 14:07
Show Gist options
  • Save singerxt/39ecc32967c71a64eba4 to your computer and use it in GitHub Desktop.
Save singerxt/39ecc32967c71a64eba4 to your computer and use it in GitHub Desktop.
var object = {
method: function () {
console.log('foo');
},
method2: function () {
var that = this;
$('.button').on('click', function () {
that.method();
});
}
}
var object = {
method: function () {
console.log('foo');
},
method2: function () {
$('.button').on('click', function () {
object.method();
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment