- 博客(2)
- 收藏
- 关注
关于DOM遍历
关于DOM遍历的补充:如前所述,IE6 DOM中childNodes.length每次都是要遍历所有节点统计个数得出的。而childNodes[i]的访问,也要遍历直到第i个元素。所以在子节点数量巨大的情况下(超过1000),不宜使用for循环来遍历childNodes,否则会死得很惨。而应使用这样的遍历方法:[code]var node = elem.firstChild;w...
2008-06-20 19:04:06
89
一个很有用的Prototype扩展---outerHTML方法
[code="js"]if(typeof(HTMLElement)!="undefined" && !window.opera) { HTMLElement.prototype.__defineGetter__("outerHTML",function() { var a=this.attributes, str=""; re...
2008-06-20 18:00:45
113
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅