[JavaScript]代码
<body onload="redirector();"></body> <table> <tr> <td><span id="redirector"> </tr> </table>
var n=3; //设定时间3s function redirector(){ if(n+1>0){ //标题提示 document.title="本页将在" + n + "秒后跳转到登录界面!"; //页面提示 document.getElementById('redirector').innerHTML="本页将在 <span style=/"color:red;/"> " + n + " 秒后跳转到登录界面!"; n--; setTimeout("redirector()",1000); //1s后执行redirector() } else { window.location.href="defaultHome.action"; } }
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/8704.html