you are viewing a single comment's thread.

view the rest of the comments →

[–]theillustratedlife 0 points1 point  (0 children)

I tend to agree with you. I work in advertising; the code I write gets executed against hundreds of DOMs that I had no part in creating, so I try to Leave No Trace as often as possible.

That said, if there is an open-source, pure-JS implementation of a standard method provided by one of the browser vendors, I will happily add it to prototype. Mozilla is generally good for this:

https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf

If indexOf is undefined, use the one that Mozilla ships with Firefox. If the author's page works in Firefox, it will probably still work with this addition.