问题描述
我想将一个方法添加(原型)到由 document.getElementsByName()(和相关的,即NodeList和HTMLCollection)返回的节点列表中。
遗憾的是,NodeList和HTMLCollection接口似乎都不是Firefox中的原型。 (NodeList适用于Safari和Opera,不知道IE浏览器)
有没有人知道如何解决这个问题?
注意:这个问题已经讨论过了,虽然我没有找到解决这个问题的方法。 (除了原型到Object接口之外)。
I want to add (prototype) a method to the node list returned by document.getElementsByName() (and related, i.e. NodeList resp. HTMLCollection).
unfortunately, neither the NodeList nor the HTMLCollection interface seem to be prototypable in Firefox. (NodeList works in Safari & Opera, don''t know about IE)
has anyone of you an idea how to solve this?
note: this matter has already been discussed, though I didn''t find any solution to this problem. (beside prototyping into Object interface).
这篇关于如何在Firefox中扩展document.getElementsBy *()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!