Tag Archives: this
Setting up timers and intervals inside JS objects
It may seem trivial but it has its tricky point. Usually, in procedural Javascript (this is, non object oriented programming), timers are set up passing the callback function on a string: function hello() { alert("hello"); } // Will execute hello() after 10 seconds setTimeout('hello()', 10000); For this code to work, hello() has to be [...]
