1、脚本如下
<span id="time" style="background:red">10</span>秒钟后自动跳转,如果不跳转,请点击下面链接
<script language="JavaScript1.2" 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; } setTimeout("delayURL('" + url + "')", 1000); } </script>
2、调用
<script type="text/javascript"> delayURL("您需要跳转到的目标页面"); </script>