When the anonymous function you've passed to window.setTimeout is called, this will be pointing to the global scope, rather than the specific object instance that called setTimeout. This is one of the confusing quirks of javascript code. There are several possible solutions in the answers to this SO question[^]. For example:
Save the outer this reference:
var me = this;
window.setTimeout(function(){me.on()}, 5000);
For modern browsers, use the built-in bind function[^]:
window.setTimeout(this.on.bind(this), 5000);
Use jQuery's proxy method[^]:
window.setTimeout($.proxy(this.on, this), 5000);
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer