今天看视频学习时学习了一种新技术,即平时我们在一个页面点击“提交”或“确认”会自动跳转到一个页面。 在网上搜了一下,关于这个技术处理有多种方法,我只记下我在视频里学到的三种: 1、用一个response.sendRedirect("目标页面.jsp.htm");实现直接跳转; 2、有时我们需要有点提示,比如“x秒后自动跳转,若没有跳转,请点击此处”,则可以在myeclipse中调用Snippets中的Delay Go To URL.会自动生成如下代码: 复制代码 代码如下: <script language="JavaScript1.2" type="text/javascript"> <!-- // Place this in the "head" section of your page. function delayURL(url, time) { setTimeout("top.location.href="" + url + """, time); } //--> </script> <!-- Place this in the "body" section --> <a href="javascript:" onClick="delayURL("myPage.html","2000")">My Delayed Link</a>