首页 > 编程知识 正文

js全局替换回车换行符,jquery字符串截取

时间:2023-05-04 07:30:39 阅读:36619 作者:3175

考虑事项:

//*

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 ';

}

}

返回结果;

}

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。