搜索

最新评论

友情博客

RSS

我的 Blog:
hahasmile 最新的 20 条日志
[转载文章]
[技术文章]
[美工]
[全部都是我!]
全站 Blog:
全站最新的 20 条日志
 
如何让浏览者无法"查看"或"复制"网页的source code?

1.右键控制(但此方法不能彻底解决复制问题)
<body oncontextmenu="window.event.returnValue=false;alert("'您无法使用右键表单进行复制!'");">
2.无法选取任何物件
<body onselectstart="return false" onselect="document.selection.empty()" onondragstart="return false">
3.无法存储网页
<html>
<head>
<script language="vbscript">
dim WshShell
Set WshShell=CreateObject("WScript.Shell")

Function WriteREG()
WshShell.RegWrite "HKCU\Software\Policies\Microsoft\Internet Explorer\Restrictions\NoViewSource","1","REG_DWORD"
End Function
</script>
</head>
<body onLoad="WriteREG()">
</body>
</html>

以上方法只针对IE浏览器.以上方法结合使用,可解决问题

hahasmile 发表于 2006-7-6  [所属栏目:技术文章 | 返回首页]
小字体中字体大字体
评论(共 {Count} 条)
{CommentAuthor}:
{CommentTime}
{CommentUrl}
{CommentEmail}
{CommentIp}
{CommentContent}