5秒后跳转到另一个页面的js代码_javascript技巧: 代码如下: 5秒后跳转到另一个页面 var t = 5; function countDown(){ var time = document.getElementById(time); t--; time.value=t; if (tlocation.href=http://www.baidu.com; clearInterv
导读5秒后跳转到另一个页面的js代码_javascript技巧: 代码如下: 5秒后跳转到另一个页面 var t = 5; function countDown(){ var time = document.getElementById(time); t--; time.value=t; if (tlocation.href=http://www.baidu.com; clearInterv
代码如下:
5秒后跳转到另一个页面
var t = 5; function countDown(){ var time = document.getElementById("time"); t--; time.value=t; if (t<=0) { location.href="http://www.baidu.com"; clearInterval(inter); }; } var inter = setInterval("countDown()",1000); //window.onload=countDown; script>
5秒后跳转到另一个页面的js代码_javascript技巧
5秒后跳转到另一个页面的js代码_javascript技巧: 代码如下: 5秒后跳转到另一个页面 var t = 5; function countDown(){ var time = document.getElementById(time); t--; time.value=t; if (tlocation.href=http://www.baidu.com; clearInterv