考虑事项:
//*
this.getstyle=function(n,p ) {
return n.currentStyle?
n.currentStyle[p] :
document.default view.getcomputedstyle (n,null ).getPropertyValue(p ) p;
}
//*
this.totext=function(node ) {
var result=' ';
if (node.nodetype==document.text _ node ) {
//Replace repeated spaces,newlines,and tabs with a single space。
result=node.nodevalue.replace (/s/g,'');
}
else {
for(varI=0,j=node.childNodes.length; i j; I ) {
result=_ this.totext (node.child nodes [ I ];
}
vard=_this.getstyle(node,' display ' );
if(d.match(/^block/)|d.match )/list/)|d.match )/row/
node.tagname==' br '|| node.tagname==' HR ' }
result ='n ';
}
}
返回结果;
}