因为比较常用,所以写在博客里保存起来,防止以后忘了不会写了:
删除成功,<span id="time" style="background:red">3</span>秒钟后自动跳转,如果不跳转,请点击下面链接 <script type="text/javascript"> function delayURL(url) { var delay = document.getElementById("time").innerHTML; if(delay > 0) { delay -- ; document.getElementById("time").innerHTML=delay; } else { window.location.href = url; } setTimeout("delayURL(‘" +url+ "‘)",1000); } </script> <a href="article.jsp" >主题列表</a> <script type="text/javascript"> delayURL("article.jsp"); </script>
时间: 2024-10-03 19:13:44