點擊返回沒有用,咋回事?
<!DOCTYPE html>
<html>
<head>
? ? <title>瀏覽器對象</title>
? ? <meta http-equiv="Content-Type" content="text/html; charset=gkb" />
? ? <style type="text/css">
? ? a{
? ? ? cursor:pointer;
? ? ? color:blue;
? ? }
? ? </style>
</head>
<body>
? ? <h4>操作成功</h4>
? ? <p><span id="time">5</span>秒后回到主頁<a onclick="goBack()">返回</a></p>
? ? <script type="text/javascript">
? ? ? //獲取頁面秒數(shù)5,存儲在num;
? ? ? var num = 5;
? ? ? function timeCount(){
? ? ? ? document.getElementById("time").innerHTML=num;
? ? ? ? num--;
? ? ? ? if (num == 0){
? ? ? ? ? location.assign('http://idcbgp.cn');
? ? ? ? }
? ? ? }
? ? ? setInterval('timeCount()',1000);
? ? ? function goBack(){
? ? ? ? window.history.back();
? ? ? }
? ? </script>
</body>
</html>
2018-06-18
要定義一個初始頁面跳轉到這個有返回標簽的頁面,否則你怎么可能返回