Created
May 19, 2011 15:10
-
-
Save kaaes/980980 to your computer and use it in GitHub Desktop.
Watch out for context part 3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var el = document.getElementById('showCounterTrigger'); | |
el.onclick = function(evt) { logger.getCounter() } | |
// if you're operating in ECMA5 environment (webkit or gecko) | |
// you can also use bind() (more about bind below) | |
el.onclick = logger.getCounter.bind(logger); | |
// just remember that every event callback has an event object | |
// passed as a first parameter, so be careful when reusing methods |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment