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

 时间: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如何在资源管理器新的窗口打开文件夹
  • 热门搜索
    牙神经痛怎么快速止痛 猪肝怎么炒好吃 wow怎么读 晒伤怎么办 怎么打飞机 产权70年到期怎么办 生育津贴怎么领 血压低怎么回事 哺乳期发烧怎么办 钡怎么读