<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; /> <script type="text/javascript" src=jquery.min.js"></script> <title></title> </head> <body onload="redirector();"></body> <table> <tr> <td><span id="redirector"></span> </tr> </table> <script> var n=3; //设定时间3s function redirector(){ if(n+1>0){ //标题提示 document.title="本页将在" + n + "秒后跳转到登录界面!"; //页面提示 document.getElementById('redirector').innerHTML="本页将在 <span style=\"color:red;\"> " + n + "</span> 秒后跳转到登录界面!"; n--; setTimeout("redirector()",1000); //1s后执行redirector() } else { window.location.href="defaultHome.action"; } } </script> </html>
<span style="font-size:14px;">欢迎加入Java交流群,不管是前端后端都是一个很好的学习平台哦,群号:398918539</span>
版权声明:本文为博主原创文章,未经博主允许不得转载。
原文地址:http://blog.csdn.net/u010407050/article/details/46744071