<strong>setInterval版</strong> <br><div class="codetitle"> <span><a style="CURSOR: pointer" data="34672" class="copybut" id="copybut34672" onclick="doCopy('code34672')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code34672"> <br>$(function () { <br>setInterval(function () { <br>var time = $("#time").text(); <br>time = parseInt(time); <br>time--; <br>if (time >0) { <br>$("#time").text(time); <br>} else { <br>window.location = $("#url").attr("href"); <br>} <br>}, 1000); <br>}); <br> </div> <br><strong>SetTimeOut版</strong> <br><div class="codetitle"> <span><a style="CURSOR: pointer" data="26386" class="copybut" id="copybut26386" onclick="doCopy('code26386')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code26386"> <br><script type="text/javascript"> <BR>window.onload = function () { <BR>setTimeout(changeTime, 1000); <BR>} <BR>function changeTime() { <BR>var time = document.getElementById("time").innerHTML; <BR>time = parseInt(time); <BR>time--; <BR>if (time <= 0) { <BR>var url = document.getElementById("url").href; <BR>window.location = url; <BR>} else { <BR>document.getElementById("time").innerHTML= time; <BR>setTimeout(changeTime, 1000); <BR>} <BR>} <BR></script> <br> </div> <br>html <br><div class="codetitle"> <span><a style="CURSOR: pointer" data="4359" class="copybut" id="copybut4359" onclick="doCopy('code4359')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code4359"> <br><span style="font-size: 18px; color: Red" id="time">5</span>秒钟以后跳转到 <a href="<%=this.url%20%>"></a> </div>