[Greasemonkey] setTimeout() problems

Jeremy Dunck jdunck at gmail.com
Wed May 24 09:18:16 EDT 2006


On 5/24/06, Premshree Pillai <premshree.pillai at gmail.com> wrote:
>    var foo = "bleh";
>    window.setTimeout(function(arg) { alert(arg); }(foo), 300);

That's the same as this (modulo the actual alert at the time
setTimeout is called):
window.setTimeout(void, 300);

I think you mean this:

window.setTimeout(function() {
  function(arg) { alert(arg); }(foo)
}, 300);

or perhaps this:

window.setTimeout(function() {
  alert(foo)
}, 300);


More information about the Greasemonkey mailing list