It's basically a rewrite. I think the script at that link doesn't resemble what you originally downloaded any more, either
It doesn't use eval() any more, but it does use innerHTML, which isn't much better really (and it's non-standard, too).
Interestingly, on the new version in Fx3, once the end of the input has been reached, it's still possible to type the characters 'l', 'u', 't', 'q', and 'b', although they get removed onkeyup. Other characters don't get entered. I'm quite baffled as to why that's happening.
ddadmin:
Code:
addEvent:function(targetarr, functionref, tasktype){
if (targetarr.length>0){
var target=targetarr.shift()
if (target.addEventListener)
target.addEventListener(tasktype, functionref, false)
else if (target.attachEvent)
target.attachEvent('on'+tasktype, function(){return functionref.call(target, window.event)})
this.addEvent(targetarr, functionref, tasktype)
}
}
While I like the style, recursion should really be avoided in Javascript. It's not tail-call optimised, quite slow, and has a fairly low recursion limit (about 1000 times in Spidermonkey, as I recall). It's for this reason that we usually implement map() &c. in terms of a for loop rather than the more natural recursive form.
Bookmarks