Y
Hacker News
new
|
ask
|
show
|
jobs
by
cwmma
4913 days ago
Another exception, functions invoked with setInterval have 'this' be window, even if they're invoked in context with it's own 'this'. This got me the other day.
https://developer.mozilla.org/en-US/docs/DOM/window.setInter...
1 comments
jQueryIsAwesome
4913 days ago
A workaround that I like a little more:
http://javascriptisawesome.blogspot.com/2011/11/setinterval-...
link
cwmma
4913 days ago
There are totally a bunch of workarounds, it's just another exception to this, I was using CoffeeScript so I was able to grossly simplify the MDN one
https://github.com/calvinmetcalf/communist/blob/master/src/s...
link