怎么让别人无法查看自己的网页源代码

 时间:2024-11-20 16:05:31

1、首先声明一个函数为clearfunction clear()

2、对该页面body的源代码资源设置为不可读取Source=document.body.firstChild.data;document.open();document.close();document.body.innerHTML=Source;

3、在html页面的body中执行clear<body onload="clear()">

4、完整禁止查看网页源代码的写法<!--把下面代码加到<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()">OK了,现在可以鼠标右键点击查看是否有效

  • c#如何设置button的FlatStyle属性
  • 如何开启计算机系统的“干净启动”模式?
  • css如何实现文字首行缩进
  • CMD命令删除文件
  • Windows 10如何在资源管理器新的窗口打开文件夹
  • 热门搜索
    苹果肌是什么 first name是什么意思 日全食是什么意思 脖子上长痘痘是什么原因 中水是什么水 gl什么意思 出汗太多是什么原因造成的 北极熊的皮肤是什么颜色的 买什么手机好 离婚证什么颜色