<body>
<h2>操作成功</h2>
<p><span id="s">5</span>秒后回到主页<a href="javascript:back()">返回</a></p><!--先编写好网页布局-->
<script type="text/javascript">
var scd=document.getElementById("s").innerHTML;
var scd=5;
function sd()
{scd--;
setInterval(sd,1000);
if (scd==0)
{i=setInterval(sd,1000);
clearInterval(i);
location.replace("http://www.imooc.com/");
}
}
//获取显示秒数的元素,通过定时器来更改秒数。
function back()
{window.history.go(-1);}
//通过window的location和history对象来控制网页的跳转。
</script>
</body>
指创生活
qq_慕UI9367020
LHammer
相关分类