1.3秒后自动返回 复制代码 代码如下: 3秒后自动返回 <BR><!-- <BR>var second = document.getElementById('totalSecond').textContent; <BR>if (navigator.appName.indexOf("Explorer") > -1) //判断是IE浏览器还是Firefox浏览器,采用相应措施取得秒数 <BR>{ <BR>second = document.getElementById('totalSecond').innerText; <BR>} else <BR>{ <BR>second = document.getElementById('totalSecond').textContent; <BR>} <BR>setInterval("redirect()", 1000); //每1秒钟调用redirect()方法一次 <BR>function redirect() <BR>{ <BR>if (second < 0) <BR>{ <BR>location.href = 'http://www.baidu.com'; <BR>} else <BR>{ <BR>if (navigator.appName.indexOf("Explorer") > -1) <BR>{ <BR>document.getElementById('totalSecond').innerText = second--; <BR>} else <BR>{ <BR>document.getElementById('totalSecond').textContent = second--; <BR>} <BR>} <BR>} <BR>--> <BR>