1、文章采集辅助工具 这个是给某网站编辑定做的工具,他们用的CMS只支持用作分段,而采集到的文章的HTML往往五花八门,所以才需要这个工具。 文档处理系列 var initHTML ="<script type=\"text/javascript\"><!-- google_ad_client = \"pub-2435639364513187\";google_ad_width = 180;google_ad_height = 60;google_ad_format = \"180x60_as_rimg\";google_cpa_choice = \"CAAQ0cX8zwEaCEej0uUJfDpNKPu_93MwAA\";google_ad_channel = \"\";//-->"+"ipt><script type=\"text/javascript\" src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\">"+"ipt><H1>《Bound0 全能网页客户端》<P><FONT color=#ff0000><STRONG>《Bound0 全能网页客户端》是一个安装在客户端的可执行程序(EXE),可以响应网页上的链接和脚本的动作,有很多功能(包括<STRONG>运行本地程序、读写本地文件和注册表等)。 为了防范被滥用或不正当地利用,对《Bound0 全能网页客户端》采用了以下安全措施: <EM>1、《Bound0 全能网页客户端》的安装和注册过程完全在<FONT color=#ff0000><STRONG>用户知情的条件下进行; 2、每一份售出的《Bound0 全能网页客户端》所具有的实际功能<FONT color=#ff0000><STRONG>根据具体需要设定,实际不需要的功能不会被开放; 3、《Bound0 全能网页客户端》对网页的响应经过<FONT color=#ff0000><STRONG>特别限制,不会对<FONT color=#ff0000><STRONG>授权范围以外的网页做出响应; 4、对每一份售出的《Bound0 全能网页客户端》拷贝均<FONT color=#ff0000><STRONG>留有记录。 请说明你的具体需要(想要实现什么样的功能),我会做出一个<STRONG><EM>示例网页来让你看,如果觉得<STRONG><EM>确实能够满足需要再购买。" function start() { Editor.document.designMode="ON"; Editor.document.open(); Editor.document.write(initHTML); Editor.document.close(); } function formatfor(va) { var t = va.replace(/(<(script|textarea|style|iframe|object).*?>)([\s\S]*?)(<\/\2>)/img,''); t=t.replace(/<br\s*\/*>/img,'<p>').replace(/<hr\s*\/*>/img,'<p>'); t = t.replace(/(<(center|div|h).*?>)([\s\S]*?)(<\/\2.*?>)/img, function (){return '<p>'+arguments[3].replace(/\n/g, "\r")+""}); t = t.replace(/<(xmp|pre).*?>/img, function(){return "<p><"+arguments[1]+">"}); t=t.replace(/<([a-z]+).*?>/img,function(){if(arguments[1].match(/^(p|strong|font|em|i|u|s|sup|sub|b|xmp|pre|img|table|tr|td|tbody|a)$/ig)){return arguments[0].replace(/\s(class|language|onmouseup|oncontextmenu|onrowexit|onbeforepaste|onactivate|lang|onmousemove|onmove|onselectstart|oncontrolselect|onkeypress|oncut|onrowenter|onmousedown|onpaste|className|id|onreadystatechange|onbeforedeactivate|onkeydown|clientWidth|onlosecapture|ondrag|ondragstart|oncellchange|recordNumber|onfilterchange|onrowsinserted|ondatasetcomplete|onmousewheel|ondragenter|onblur|onresizeend|onerrorupdate|onbeforecopy|ondblclick|onkeyup|onresizestart|onmouseover|onmouseleave|onmoveend|title|onresize|ondrop|onpage|onrowsdelete|style|onfocusout|ondatasetchanged|ondeactivate|onpropertychange|ondragover|onhelp|ondragend|onbeforeeditfocus|onfocus|behaviorUrns|onscroll|onbeforeactivate|onbeforecut|onclick|oncopy|onfocusin|onbeforeupdate|ondataavailable|onmovestart|onmouseout|offsetTop|onmouseenter|onlayoutcomplete|offsetParent|onafterupdate|ondragleave|onerror|onabort|vrml|onload)=("|')[^\2]*(\2)/ig,'')}else{return ''}}); t=t.replace(/<\/([a-z]+).*?>/img,function(){if(arguments[1].match(/^(p|strong|font|em|i|u|s|sup|sub|b|xmp|pre|img|table|tr|td|tbody|a)$/ig)){return arguments[0].replace(/\s(class|language|onmouseup|oncontextmenu|onrowexit|onbeforepaste|onactivate|lang|onmousemove|onmove|onselectstart|oncontrolselect|onkeypress|oncut|onrowenter|onmousedown|onpaste|className|id|onreadystatechange|onbeforedeactivate|onkeydown|clientWidth|onlosecapture|ondrag|ondragstart|oncellchange|recordNumber|onfilterchange|onrowsinserted|ondatasetcomplete|onmousewheel|ondragenter|onblur|onresizeend|onerrorupdate|onbeforecopy|ondblclick|onkeyup|onresizestart|onmouseover|onmouseleave|onmoveend|title|onresize|ondrop|onpage|onrowsdelete|style|onfocusout|ondatasetchanged|ondeactivate|onpropertychange|ondragover|onhelp|ondragend|onbeforeeditfocus|onfocus|behaviorUrns|onscroll|onbeforeactivate|onbeforecut|onclick|oncopy|onfocusin|onbeforeupdate|ondataavailable|onmovestart|onmouseout|offsetTop|onmouseenter|onlayoutcomplete|offsetParent|onafterupdate|ondragleave|onerror|onabort|vrml|onload)=("|')[^\2]*(\2)/ig,'')}else{return ''}}); return t } /* **************************************** Created by Bound0 (bound0@tom.com) 最早发表于 http://bbs.blueidea.com/thread-2764053-1-1.html 随时更新,请经常访问。 转载或应用时请保留此声明! **************************************** */ function first() { Editor.document.body.innerHTML=formatfor(Editor.document.body.innerHTML) output.value=Editor.document.body.innerHTML} 先把网页内容贴进去 再点击这个按钮 <!-- google_ad_client = "pub-2435639364513187"; google_ad_width = 120; google_ad_height = 240; google_ad_format = "120x240_as_rimg"; google_cpa_choice = "CAAQw8P8zwEaCHiG_fvJAyDKKKG_93MwAA"; google_ad_channel = ""; //--> [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]