在来个防止网页查看-源文件的代码
要求:要写在<head></head>中的!要好用,马上给分 在线坐等
谢谢各位大虾了!

解决方案 »

  1.   

    我这有个例子<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>禁止“查看源文件”的网页</title>
    <meta http-equiv="content-Type" content="text/html;charset=gb2312">
    <!--把下面代码加到<head>与</head>之间-->
    <script language="javascript">
    function clear(){ 
    Source=document.body.firstChild.data;
    document.open();
    document.close();
    document.body.innerHTML=Source;
    }
    </script>
    </head>
    <!--把<body>改为-->
    <body onload="clear()">   
    点击IE工具栏上的“查看”-“查看源文件”试试!
    </body>
    </html>
      

  2.   


    不会啊.  你就把这段代码另存为HTML. 就行了啊
      

  3.   

    套个IFRAME吧
    禁用右键但这种方法还不能完全禁止
      

  4.   

    http://blog.csdn.net/mzoy/archive/2008/10/07/3028928.aspx 看看这个
      

  5.   

    这条路走不通。
    如果你不怕网页加载量 增加,可以将html代码个JS加个密。
      

  6.   


    <body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0" oncontextmenu="return 
    false" ondragstart="return false" onselectstart ="return false" 
    onselect="document.selection.empty()" oncopy="document.selection.empty()" 
    onbeforecopy="return false" onmouseup="document.selection.empty()"> 
    右键或者选择复制目标测试!
    </body>
      

  7.   

    常规手段是行不通的,因为B/S,Server端传给浏览器是明文的,一些HTML标签+文本+图片.要使用非常规手段,胖客户端的形式,自己写一个解析的组件,嵌入浏览器,浏览器只是提供一个连接到Server的下载该组件的功能功能.
    其余的连接服务器接受资料,解析资料都有该组件来完成.
    服务器端负责握手,发放密钥,加密资料,发送资料到组件.