<!DOCTYPE html>
<html>
<head>
<title>浏览器对象</title>
<meta http-equiv="Content-Type" content="text/html; charset=gkb"/>
</head>
<body>
<!--先编写好网页布局-->
<p>操作成功</p>
<p><span id="num">5</span>秒后返回主页<input type="button" value="返回" onclick="goback()"></p>
<script type="text/javascript">
var num=5;
function numChange(){
num--;
if(num<0)
window.location.href('www.imooc.com');
else
document.getElementById('num').innerHTML=num;
setTimeout('numChange',1000);
}
function goback(){
window.history.go(-1);
}
setTimeout('numChange,1000');
</script>
</body>
</html>