Alternative to Element.prototype?

L

Lachlan Hunt

Hi,
I've been working on a script to implement DOM2 Events interfaces
[1], and a few other extensions, in browsers that don't support them
natively. It's been tested and works in Firefox 1.0.6/1.5b1 (Win and
Mac), IE6, Opera 8.02 (Win and Mac) and Safari 1.3.1. [2] (It doesn't
work in IE5/Mac)

At the moment, to apply the methods to all elements in browsers that
don't support the Element and/or Node interfaces, I iterate through all
the elements and apply each method individually. Of course, this can
potentially be a very slow process, particularly for large documents.
Plus, it doesn't apply the methods to elements created after the
document is loaded.

So, I'm wondering if there is another method I can use in the absense of
Element.prototype? I had thought about using Object.prototype instead,
and it worked for my tests, but I've since found out that doing so can
be harmful to the use of objects as hash tables [3]. Any ideas?

[1] http://lachy.id.au/dev/script/examples/DOM/DOM.js
[2] http://lachy.id.au/dev/script/examples/DOM/demo/
[3] http://erik.eae.net/archives/2005/06/06/22.13.54/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top