[thelist] setInterval arguments (for IE6)

Andreas Wahlin Andreas.Wahlin at ufl.gu.se
Mon Jul 5 07:48:10 CDT 2004

How can I pass arguments in to a setInterval?
I tried

window.setInterval(function(arg) { window.status = arg; }, 500, 'hello

Which would set the statusbar to hello world every 1/2 seconds. This
worked fine in Opera and Firefox, but in IE the argument wasn't passed.
The solution I found was this

window.setInterval("external(\""+hello world+"\")", 500);

Function external(arg) {
  window.status = arg;

(the code is taken from memory, not guaranteed to exactly work)

This is ugly and clumsy and I hate it, anyone with a better suggestion??


More information about the thelist mailing list