jjzjj

StaticNodeList

全部标签

javascript - 为什么 document.querySelectorAll 返回一个 StaticNodeList 而不是一个真正的数组?

令我烦恼的是,即使在Firefox3.6中我也不能只执行document.querySelectorAll(...).map(...),而且我仍然找不到答案,所以我想我应该交叉发布来自这个博客的问题:http://blowery.org/2008/08/29/yay-for-queryselectorall-boo-for-staticnodelist/有谁知道您得不到数组的技术原因吗?或者为什么StaticNodeList不以您可以使用map、concat等的方式从Array继承?(顺便说一句,如果它只是您想要的一个功能,您可以执行类似NodeList.prototype.map=A

javascript - 为什么 document.querySelectorAll 返回一个 StaticNodeList 而不是一个真正的数组?

令我烦恼的是,即使在Firefox3.6中我也不能只执行document.querySelectorAll(...).map(...),而且我仍然找不到答案,所以我想我应该交叉发布来自这个博客的问题:http://blowery.org/2008/08/29/yay-for-queryselectorall-boo-for-staticnodelist/有谁知道您得不到数组的技术原因吗?或者为什么StaticNodeList不以您可以使用map、concat等的方式从Array继承?(顺便说一句,如果它只是您想要的一个功能,您可以执行类似NodeList.prototype.map=A