1. 程式人生 > >?秒後自動跳轉

?秒後自動跳轉

1,在標籤中建立onload事件,用作自動重新整理;

?
1 <body onload="shownum()">

2,在<script>中編寫onload事件:

?
1 2 3 4 5 6 <script type="text/javascript"> var i = 6; function shownum(){ i=i-1; document.getElementById("time").innerHTML=i+"秒後自動跳轉登陸 介面"; setTimeout('shownum()'
,1000); } </script>

3,編寫自動跳轉事件:

?
1 <meta http-equiv="refresh" content ="5;url=<%=basePath%>jsp/login.jsp">