18202918669

输入密码才能浏览网页内容的JS代码

文章出处: │ 网站编辑:西安网站建设 │ 发表时间:2023-06-02 10:23

如何给网页HTML添加**访问网站页面三种简单的JS方法。把以下三种方法任意选择一种JS代码加在body和/body中间位置即可实现。快来试一下吧!!!

方法一:

<script type="text/javascript">   loopy()   function loopy() {   var sWord =""  while (sWord != "henenseo") {//设置** 初始**codekesWord = prompt("输入正确**才能登陆!")   }   alert("欢迎访问")   }   </script>

 

方法二:

<script type="text/javascript">   function password() {   var testV = 1;   var pass1 = prompt('请输入**','');   while (testV < 3) {   if (!pass1)   history.go(-1);   if (pass1 == "henenseo") {//初始**codekealert('**正确');   break;   }   testV+=1;   var pass1 =   prompt('**错误!请重新输入:');   }   if (pass1!="password" & testV ==3)   history.go(-1);   return " ";   }   document.write(password());   </script>

方法三:

<script type="text/javascript">   function password() {   var testV = 1;   var pass1 = prompt('请输入**:','');   while (testV < 3) {   if (!pass1)    history.go(-1);   if (pass1 == "henenseo") {//设置** 初始**codekealert('口令正确,进行跳转');   window.location.href="https://www.hensenseo.com/";//添加你要跳转的页面break;   }    testV+=1;   var pass1 =    prompt('**错误','');   }   if (pass1!="password" & testV ==3)    history.go(-1);   return " ";   }    document.write(password());   </script>

配合禁止查看源码代码一起使用。



本文标题:输入密码才能浏览网页内容的JS代码
文章地址:https://www.xunzhankj.com/fw_sjwzjs/10887.html

西安讯展科技官网:https://www.xunzhankj.com

全国咨询热线:029-86696770

手机/微信:18202918669

公司地址:西安市高新区高新六路唐兴路口唐兴数码4层423