Richard A. DeVenezia said:
Is some future Mozilla going to support setInterval
( <function:function>, <interval:number> ) ?
Right now it seems to be simply setInterval
( <function-text:string>, <interval:number> )
Mozilla does support passing a function reference as the first argument
to both setTimeout and setInterval.
A compatibility trick with setTimeout and setInterval is to use
exclusively function references and provide the function referred to
with its own toString method that returns a string of JavaScript source
code that would call the function via some global identifier. If the
setTimout/Interval function implementation does not support function
reference arguments it type-converts the function into the expected
string by calling its toString method. Allowing the more efficient
function references to be used where supported and providing a fallback
when unsupported. (I have posted a number of examples over the last 3 or
4 months so groups.google.com search comp.lang.javascript for my posts
(and some of Yep's) with the keyword setTimeout (and possibly toString)
to see example code).
Richard.