 
		qq_触掱钶忣倖福_0
2018-11-29 13:01
<!DOCTYPE html>
<html>
 <head>
  <title>浏览器对象</title>  
  <meta http-equiv="Content-Type" content="text/html; charset=gkb"/>   
 </head>
 <body>
  <!--先编写好网页布局-->
  <h1>操作成功</h1>
  <span id="sencond">5</span>
  <span>秒后回到主页</span>
 <a href="javascript:back">返回</a>
  <script type="text/javascript">  
 
   //获取显示秒数的元素,通过定时器来更改秒数。
var num=document.getElementById("sencond").value;
function cound()
    {
        num--;
        document.getElementById("sencond").innerHTML=num;
        if(num==0)
            {
                location.assign("www.imooc.com");
            }
    }        
            setInterval("cound()",1000);
    
   //通过window的location和history对象来控制网页的跳转。
   function back
    {
        window.history.back();
    }
 </script> 
</body>
</html>
 
				<!DOCTYPE html>
<html>
<head>
<title>浏览器对象</title>
<meta http-equiv="Content-Type" content="text/html; charset=gkb"/>
</head>
<body>
<!--先编写好网页布局-->
<h1>操作成功</h1>
<span id="second">5</span>
<span>秒后回到主页</span>
<a href="#" onclick="back();">返回</a>
<script type="text/javascript">
//获取显示秒数的元素,通过定时器来更改秒数。
var num=document.getElementById("second").innerHTML;
function cound()
{
num--;
document.getElementById("second").innerHTML=num;
if(num==0)
{
location.assign("http://www.imooc.com");
}
}
setInterval("cound()",1000);
//通过window的location和history对象来控制网页的跳转。
function back()
{
window.history.back();
}
</script>
</body>
</html>
自己对一下吧!望采纳!
JavaScript进阶篇
469062 学习 · 22582 问题
相似问题