web001 发表于 2013-1-29 08:39:25

JavaScript实现x秒后自动跳转

今天看视频学习时学习了一种新技术,即平时我们在一个页面点击“提交”或“确认”会自动跳转到一个页面。
在网上搜了一下,关于这个技术处理有多种方法,我只记下我在视频里学到的三种:
1、用一个response.sendRedirect("目标页面.jsp\.htm");实现直接跳转;
2、有时我们需要有点提示,比如“x秒后自动跳转,若没有跳转,请点击此处”,则可以在myeclipse中调用Snippets中的Delay Go To URL.会自动生成如下代码:
 
<div style="font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Consolas, 'Courier New', monospace; width: 679px; overflow: auto; margin-left: 9px; padding: 1px; line-height: 25.200000762939453px;" class="dp-highlighter"><div class="bar"><div style="padding: 3px; margin: 0px; font-weight: bold;" class="tools">Js代码  http://justjavac.iteye.com/images/icon_star.png
页: [1]
查看完整版本: JavaScript实现x秒后自动跳转