JS中 用户登录系统的解决办法
2013-04-15 00:00
369 查看
当用户输入 pwd 密码是 123 就跳到第二个页面,4秒后,自动跳转到第三个页面
login.html
ok.html
success.html
login.html
<html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> <script type="text/javascript"> //进行检查 function check(){ //window.alert($("username").value); if($("username").value=="pwd" && $("pwd").value=="123"){ return true; }else{ $("username").value=""; $("pwd").value=""; return false; } } //获取文档对象 function $(id){ return document.getElementById(id); } </script> </head> <body> <form action="ok.html"> u:<input type="text" id="username" /><br/> p:<input type="password" id="pwd" /><br/> <input type="submit" value="提交" onclick="return check()"/> </form> </body> </html>
ok.html
<html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> <script type="text/javascript"> //跳转到指定页面 function tiao(){ clearInterval(myInterval); window.open("success.html","_self"); } //设置5秒跳转 setTimeout("tiao()",5000); //改变秒数 function changeSec(){ //改变数字 $("myspan").innerText=parseInt($("myspan").innerText)-1; } var myInterval=setInterval("changeSec()",1000); //获取对象 function $(id){ return document.getElementById(id); } </script> </head> <body> 登录成功<span id="myspan">5</span>秒后自动跳转 </body> </html>
success.html
<html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> <script type="text/javascript"> </script> </head> <body> 欢迎....... </body> </html>
相关文章推荐
- JS中 用户登录系统的解决办法
- 管理员登录系统后,却加载为TEMP用户的解决办法
- moodle 迁移时用户登录不进系统的解决办法
- OEM无法登陆原因与ORACLE用户密码过期和锁定的解决办法(附上系统用户默认密码)
- suse系统解决ssh登录慢的办法
- 开机登录失败 提示"user profile service服务未能登录,无法加载用户配置文件" 问题解决办法
- 用户 'IIS APPPOOL\ASP.NET V4.0' 登录失败 解决办法…………
- 用户 'NT AUTHORITY/NETWORK SERVICE' 登录失败解决办法
- Fedora 10/11下解决不能使用root用户登录系统
- 无法打开登录所请求的数据库 ""。登录失败。 用户 'XXX\Administrator' 登录失败-的解决办法
- Win Server 2003远程桌面提示:要登录到这台远程计算机,您必须拥有这台计算机上的终端服务器用户访问权限提示的解决办法
- “用户sa登录失败,该用户与可信sql server连接无关联”解决办法
- sshSSH Secure Shell Client root用户无法登录解决办法
- ASP生成静态页面用户登录的解决办法
- [解决办法]已经安装了数字证书,但是谷歌浏览器登录https协议的web系统时仍然提示证书不受信任
- Win7网上邻居提示未授予用户在此计算机上的请求登录类型解决办法
- Mac系统登录不进系统解决办法
- tomcat配置用户登录报403错误的解决办法
- 中了MSN FUNNY病毒后,电脑登录时总是注销,无法进入系统的解决办法
- VsFTP出现500 OOPS: cannot change directory的解决办法【用匿名用户或者ftp用户登录报错】