The code copy is as follows:
<title>JS countdown web page automatically jumps code</title>
<script language="JavaScript" type="text/javascript">
function delayURL(url) {
var delay = document.getElementById("time").innerHTML;
if(delay > 0) {
delay--;
document.getElementById("time").innerHTML = delay;
} else {
window.top.location.href = url;
}
t = setTimeout("delayURL('" + url + "')", 1000);
}
function stop1(){
t && clearTimeout(t);
}
</script>
<span id="time" style="background: #00BFFF">1000</span> will automatically jump after seconds. If you do not jump, please click the link below <a href="http://www.baidu.com">My Baidu</a>
<input type="button" value="stop jump" onclick="stop1();">
<script type="text/javascript">
delayURL("http://www.baidu.com");
</script>
The code is simple but very practical. Please put it into your project according to your needs.