0 replies on 1 page.
$.fn.delayHide(time, callbackArgument) { var self = this; setTimeout(function() { callbackArgument.call(self); }, time); }
I find that I have to use the var self = this; pattern far too often in JavaScript.
var self = this;
The darn magic scoping of this really gets ya.
I also had someone ask me why foo never ended up containing something:
var foo = bar(function() { .... return something; });
It made me more worried about adding closures to Java :)
Read: var self = this;