代码驿站移动版
频道导航
HTML/Xhtml
CSS
JavaScript
HTML5
PHP教程
ASP.NET
正则表达式
AJAX
ThinkPHP
Yii
MySQL
MariaDB
Oracle
MongoDB
Redis
DedeCMS
PHPCMS
帝国CMS
WordPress
Discuz
其它CMS
Zend Studio
Sublime
Notepad
Dreamweaver
Windows
Linux
Nginx
Apache
IIS
CentOS
Ubuntu
Debian
网站优化
工具资源
PHP源码
ASP.NET源码
其它源码
图标素材
按钮素材
字体素材
DedeCMS模板
帝国CMS模板
PHPCMS模板
WordPress模板
Discuz!模板
单页模板
开发软件下载
服务器软件下载
广告投放
联系我们
版权申明
软件编程
网页前端
移动开发
数据库
服务器
脚本语言
PHP代码
JAVA代码
Python代码
Android代码
当前位置:
主页
>
网页前端
>
JavaScript代码
>
文档处理系列――随时更新
时间:2021-03-31 09:12:15 | 栏目:
JavaScript代码
| 点击:次
1、文章采集辅助工具
这个是给某网站编辑定做的工具,他们用的CMS只支持用<p>作分段,而采集到的文章的HTML往往五花八门,所以才需要这个工具。
<head> <title>文档处理系列</title> <script> 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 = \"\";//--></scr"+"ipt><script type=\"text/javascript\" src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\"></scr"+"ipt><H1>《Bound0 全能网页客户端》</H1><P><FONT color=#ff0000><STRONG>《Bound0 全能网页客户端》</STRONG>是一个安装在客户端的可执行程序(EXE),可以响应网页上的链接和脚本的动作,有很多功能(包括<STRONG>运行本地程序、读写本地文件和注册表</STRONG>等)。为了防范被滥用或不正当地利用,对《Bound0 全能网页客户端》采用了以下安全措施:<EM>1、《Bound0 全能网页客户端》的安装和注册过程完全在<FONT color=#ff0000><STRONG>用户知情</STRONG>的条件下进行;2、每一份售出的《Bound0 全能网页客户端》所具有的实际功能<FONT color=#ff0000><STRONG>根据具体需要设定</STRONG>,实际不需要的功能不会被开放;3、《Bound0 全能网页客户端》对网页的响应经过<FONT color=#ff0000><STRONG>特别限制</STRONG>,不会对<FONT color=#ff0000><STRONG>授权范围</STRONG>以外的网页做出响应;4、对每一份售出的《Bound0 全能网页客户端》拷贝均<FONT color=#ff0000><STRONG>留有记录</STRONG>。</EM>请说明你的具体需要(想要实现什么样的功能),我会做出一个<STRONG><EM>示例网页</EM></STRONG>来让你看,如果觉得<STRONG><EM>确实能够满足需要</EM></STRONG>再购买。</P>" 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")+"</p>"}); 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} </script> </head> <body SCROLL="auto" bgcolor=d0d0c8 onload="start()" leftmargin=5 topmargin=5> <IFRAME id="Editor" Name="Editor" style="WIDTH: 550; HEIGHT: 480"></IFRAME> <button onclick=first()>先把网页内容贴进去再点击<font color=red>这个</font>按钮</button> <textarea name="output" style="WIDTH: 550; HEIGHT: 480"></textarea><script type="text/javascript"><!-- 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 = ""; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script></body>
[Ctrl+A 全选 注:
引入外部Js需再刷新一下页面才能执行
]
您可能感兴趣的文章:
JavaScript常见事件处理程序实例总结
Javascript的匿名函数小结
url传递的参数值中包含&时,url自动截断问题的解决方法
javascript上下左右定时滚动插件
Javascript别踩白块儿(钢琴块儿)小游戏实现代码
相关文章
11-08
兼容浏览器的js事件绑定函数(详解)
11-23
Webpack中loader打包各种文件的方法实例
11-27
Javascript实例教程(19) 使用HoTMetal(2)
10-05
javascript判断图片是否加载完成的方法推荐
11-22
在javascript中执行任意html代码的方法示例解读
JQuery
VUE
AngularJS
MSSql
MySQL
MongoDB
Redis
Linux
Tomcat
Nginx
网站首页
广告投放
联系我们
版权申明
联系站长