復制代碼 代碼如下:
<script type="text/javascript">
function closeIt() {
window.opener = '';
window.open('http://www.baidu.com');
window.open('', '_self');
window.close();
}
self.setInterval("newTime()", 1000)
var t = 4;
function newTime() {
if (t > 0) {
t = t - 1;
document.getElementById("txtTime").value = t
}
else if (t <= 0) {
closeIt();
}
else {
closeIt();
}
}
</script>