Countdown and automatic jump pages in JSP

  • 2020-12-20 03:43:00
  • OfStack

My teacher told me to write blog, and then I had to rediscover the blog I had kept untouched for many years. Today, I will share the countdown and automatic page jump in JSP

Crazy and then just finally code, the web page error.

1. Set up onload event in the tag for automatic refresh;


<body onload="shownum()">

2, in < script > Write onload events in:


<script type="text/javascript"> 
var i = 6; function shownum(){ 
i=i-1; document.getElementById("time").innerHTML=i+" Jump to login automatically after seconds 
 interface ";
setTimeout('shownum()',1000); } 
</script>

3. Write automatic jump events:


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

4, get


Related articles: