当前位置: 首页 > 图文教程 > 网络编程 > Javascript > 复制文章自动附加版权信息

Javascript
Add a Table to a Word Document
Add Formatted Text to a Word Document
用jscript实现新建word文档
用jscript实现新建和保存一个word文档
Open and Print a Word Document
Use Word to Search for Files
Convert Seconds To Hours
Sample script that deletes a SQL Server database
Sample script that displays all of the users in a given SQL Server DB
firefox中用javascript实现鼠标位置的定位
div+css实现鼠标放上去,背景跟图片都会变化。
Locate a File Using a File Open Dialog Box
Save a File Using a File Save Dialog Box
用jscript实现列出安装的软件列表
List the Stored Procedures in a SQL Server database
Display SQL Server Login Mode
Display SQL Server Version Information
List all the Databases on a SQL Server
用jscript启动sqlserver
Stop SQL Server

Javascript 中的 复制文章自动附加版权信息


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-28   浏览: 369 ::
收藏到网摘: n/a

不知道大家发现了没有,在本站上面复制文章中的任意一段话,结尾总是出现“本篇文章来源于软晨学习网(www.ruanchen.com)详细出处参考:/XXXXXXXXXXXXXXXXX”这样的话。这样对网站文章的版权保护可以有点作用。而且还有一个好处就是当别人采集你网站内容的时候这些版权信息也会跟着采集进去,这样就可以大大增加你的外部链接。实现这个效果只要在网页的任意一处插入下面这段代码即可。

<script type="text/javascript">
document.body.oncopy = function () { setTimeout( function () { var text = clipboardData.getData("text"); if (text) { text = text + "/本篇文章来源于软晨学习网(www.ruanchen.com)原文出处:"+location.href; clipboardData.setData("text", text); } }, 100 ) }
</script>
 

只要把代码中的“本篇文章来源于 软晨学习网(www.ruanchen.com)”改成你的网站信息即可。