jsp页面跳转
2013-10-07 15:42
316 查看
<inputname="Button" type="button" class="btn_grey"value="购买商品!"onClick="window.location.href='index.jsp'">
"window.location.href"、"location.href"是本页面跳转
"parent.location.href"是上一层页面跳转
"top.location.href"是最外层的页面跳转
举例说明:
如果A,B,C,D都是jsp,D是C的iframe,C是B的iframe,B是A的iframe,如果D中js这样写
"window.location.href"、"location.href":D页面跳转
"parent.location.href":C页面跳转
"top.location.href":A页面跳转
如果D页面中有form的话,
<form>: form提交后D页面跳转
<form target="_blank">:form提交后弹出新页面
<form target="_parent">:form提交后C页面跳转
<form target="_top"> : form提交后A页面跳转
关于页面刷新,D 页面中这样写:
response.sendRedirect("index.jsp");跳转到index.jsp页面
"parent.location.reload();": C页面刷新 (当然,也可以使用子窗口的 opener 对象来获得父窗口的对象:window.opener.document.location.reload(); )
"top.location.reload();": A页面刷新
"window.location.href"、"location.href"是本页面跳转
"parent.location.href"是上一层页面跳转
"top.location.href"是最外层的页面跳转
举例说明:
如果A,B,C,D都是jsp,D是C的iframe,C是B的iframe,B是A的iframe,如果D中js这样写
"window.location.href"、"location.href":D页面跳转
"parent.location.href":C页面跳转
"top.location.href":A页面跳转
如果D页面中有form的话,
<form>: form提交后D页面跳转
<form target="_blank">:form提交后弹出新页面
<form target="_parent">:form提交后C页面跳转
<form target="_top"> : form提交后A页面跳转
关于页面刷新,D 页面中这样写:
response.sendRedirect("index.jsp");跳转到index.jsp页面
"parent.location.reload();": C页面刷新 (当然,也可以使用子窗口的 opener 对象来获得父窗口的对象:window.opener.document.location.reload(); )
"top.location.reload();": A页面刷新
相关文章推荐
- jsp页面跳转的几种方式
- JSP页面跳转的五种方法
- jsp页面跳转后台代码的方式总结~
- servlet和jsp页面跳转
- JSP中实现判断客户端手机类型并跳转到app下载页面
- jsp页面跳转方法
- JSP与Servlet几种页面跳转的区别
- Jsp中解决session过期跳转到登陆页面并跳出iframe框架的方法
- ajax跳转到新的jsp页面的方法
- HTML/JSP实现跳转到页面指定位置
- 项目访问是直接页面 <jsp:forward page="i/1/1"/>跳转前加操作逻辑
- 关于一加载jsp页面就跳转到servlet获取数据然后再跳回jsp页面的问题
- 可以自动跳转到出错页面的servlet/jsp框架
- JSP页面的跳转?
- JFinal跳转jsp页面空白
- 在action跳转的jsp页面中引入静态js、css文件
- jsp页面跳转的方法集合
- JSP页面跳转的五种方法
- JSP和Servlet中的页面跳转和重定向辨析
- 用history.back()跳转并刷新jsp页面