有些网站内容不允许别人复制,怎么做到的到呢,实现原理就是一段js比如这个网站
http://www.xttour.gov.cn/Article/ShowArticle.asp?ArticleID=229
里面的内容就复制不了,怎么解决这个问题呢
<body oncontextmenu="return false" ondragstart="return false" onselectstart="return false" onselect="document.selection.empty()" oncopy="document.selection.empty()" onbeforecopy="return false" onmouseup="document.selection.empty()" onmousemove="HideMenu()" onload="goforit()" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">
就是在body里面加了个js代码,一般浏览器是按F12 打开 “开发者模式” 然后把这段js删除就可以复制里面的内容了。同理,网站内容不想给人复制就可以加上这段代码。
更高深的还有html代码加密,那更复制不了,道高一尺魔高一丈!!!