Alternative to Element.prototype?
- From: Lachlan Hunt <spam.my.gspot@xxxxxxxxx>
- Date: Sun, 18 Sep 2005 09:08:23 GMT
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/ -- Lachlan Hunt http://lachy.id.au/ http://GetFirefox.com/ Rediscover the Web http://GetThunderbird.com/ Reclaim your Inbox .
- Prev by Date: Re: how does this function work?
- Next by Date: Re: Programming Newbie Question
- Previous by thread: Frame buster question
- Next by thread: Music on/off button
- Index(es):