<!--禁止网页另存为: -->
<noscript><iframe src=*.html></iframe></noscript>
------------------------------------------------------------------------------------禁止选择文本--------------------------------------------------
<!-- 禁止选择文本: -->
<script type="text/javascript">
var omitformtags=["input", "textarea", "select"]
omitformtags=omitformtags.join("|")
function disableselect(e){
if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
return false
}
function reEnable(){
return true
}
if (typeof document.onselectstart!="undefined")
document.onselectstart=new Function ("return false")
else{
document.onmousedown=disableselect
document.onmouseup=reEnable
}
</script>
------------------------------------------------------------------------------------禁用右键--------------------------------------------------
<!-- 禁用右键: -->
<script>
function stop(){
return false;
}
document.oncontextmenu=stop;
</script>
<noscript><iframe src=*.html></iframe></noscript>
------------------------------------------------------------------------------------禁止选择文本--------------------------------------------------
<!-- 禁止选择文本: -->
<script type="text/javascript">
var omitformtags=["input", "textarea", "select"]
omitformtags=omitformtags.join("|")
function disableselect(e){
if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
return false
}
function reEnable(){
return true
}
if (typeof document.onselectstart!="undefined")
document.onselectstart=new Function ("return false")
else{
document.onmousedown=disableselect
document.onmouseup=reEnable
}
</script>
------------------------------------------------------------------------------------禁用右键--------------------------------------------------
<!-- 禁用右键: -->
<script>
function stop(){
return false;
}
document.oncontextmenu=stop;
</script>
本文介绍了一种通过JavaScript实现的网页内容保护方法,包括禁止文本选择、禁用鼠标右键等功能,适用于希望保护网页内容不被轻易复制的情况。
6805

被折叠的 条评论
为什么被折叠?



