登入成功后自行总计秒数实施跳转,用户登陆类

时间:2019-07-31 21:30来源:2020欧洲杯冠军竞猜官方网站
script language = "javascript" type = "text/javascript" function $(id){ return document.getElementById(id); }     //获取对象     function $(id){         return document.getElementById(id);     } /script /head body 登录成

<script language = "javascript" type = "text/javascript">
function $(id){
return document.getElementById(id);
}

    //获取对象
    function $(id){
        return document.getElementById(id);
    }
</script>
</head>
<body>
登录成功<span id="myspan">5</span>秒后自动跳转
</body>
</html>

ok.html

    //进行检查
    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>

<script language = "javascript" type = "text/javascript">
setTimeout("javascript:clearInterval(mytime);window.open('manage.html')",5000);
function changeSec(){
document.getElementById("myspan").innerText =
parseInt(document.getElementById("myspan").innerText) - 1;
}
var mytime = setInterval("changeSec()",1000);
</script>
登陆成功 <span id = "myspan">5</span> 秒钟后自动跳转...

    //跳转到指定页面
    function tiao(){
        clearInterval(myInterval);
        window.open("success.html","_self");
    }
    //设置5秒跳转
    setTimeout("tiao()",5000);

welcome

复制代码 代码如下:

复制代码 代码如下:

当用户输入 pwd 密码是 123 就跳到第二个页面,4秒后,自动跳转到第三个页面
login.html

 
图片 1 

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<script type="text/javascript">

function checkUser(){
if($("u1").value == "hello" && $("p1").value == "123"){
return true;
}else{
return false;
}
}
</script>
<form action = "ok.html">
<div style = "width:300px;height:200px;border:1px solid red;background-color:pink">
<p/>
U:<input id = "u1" type = "text" value = "" /> <br><br>
P:<input id = "p1" type = "text" value = "" /> <br><br>
<input type = "submit" onclick = "return checkUser()" value = "登陆" style = "margin-left:20px"/>
</div>
</form>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<script type="text/javascript">

manage.html

ok.html

login.html

success.html

复制代码 代码如下:

复制代码 代码如下:

复制代码 代码如下:

    //改变秒数
    function changeSec(){
        //改变数字
        $("myspan").innerText=parseInt($("myspan").innerText)-1;
    }

复制代码 代码如下:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<script type="text/javascript">

pwd 密码是 123 就跳到第二个页面,4秒后,自动跳转到第三个页面 login.html 复制代码 代码如下: html head meta http-equiv="Content-Type"...

    var myInterval=setInterval("changeSec()",1000);

</script>
</head>
<body>
欢迎.......
</body>
</html>

编辑:2020欧洲杯冠军竞猜官方网站 本文来源:登入成功后自行总计秒数实施跳转,用户登陆类

关键词: 欧洲杯竞猜