1. 程式人生 > >JSP實現幾秒後自動跳轉某頁面並頁面上顯示時間在走動

JSP實現幾秒後自動跳轉某頁面並頁面上顯示時間在走動

<script language="javascript">
var times=6;
clock();
function clock()
{
   window.setTimeout('clock()',1000);
   times=times-1;
   time.innerHTML =times;
}
</script>
<head>
<meta http-equiv= "Refresh" content= "5;url=index.jsp ">
<title>Insert title here</title>
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
-->
</style>
</head>
<body>


使用者名稱密碼錯誤,請重新輸入。
<table>
<tr>
<td class= "FontBlack STYLE1">   該頁面將在 </td>
<td class= "FontBlack"> <div class="STYLE1" id= "time"> 5 </div> </td>
<td class= "FontBlack STYLE1"> 秒後自動跳轉 </td>
</tr>
</table>
</body>


</body>
</html>