首页 > 代码库 > JSP---网上商城->几秒后跳转

JSP---网上商城->几秒后跳转

 1 <% 2 int id = Integer.parseInt(request.getParameter("id")); 3 String url = request.getParameter("from"); 4 User.delete(id); 5 %> 6  7 <html> 8     <head> 9         <title>删除用户</title>10     </head>11     <body>12         <center>13             恭喜您, 删除成功!14             <br>15             <span id="delay" style="background:red">3</span>秒钟后跳转到上一页面, 或者请点击下面的链接 自己跳转16             <br>17             <a href="http://www.mamicode.com/"><%=url%></a>18         </center>19         <script type="text/javascript">    20             21             var delay = 3;22             function goBack() {23                 document.getElementById("delay").innerHTML=delay;24                 delay --;25                 if(delay == 0) 26                     document.location.href=http://www.mamicode.com/‘‘;27                 else 28                     setTimeout(goBack, 1000);29             }30             31             32             parent.main.location.reload();33             34         </script>35     </body>36 </html>

 

JSP---网上商城->几秒后跳转