页面跳转怎么从iframe中跳转出来

同级页面跳转

window.location.href="路径"   或者   location.href="路径"

上一层页面跳转语句:

parent.location.href="路径"

最外层的页面跳转语句:

top.location.href="路径"

这个是从当前的iframe跳到另一个main的iframe中去 

<script language="javascript">
 
window.parent.main .location.href= "";
 
</script>

往上一层跳和往顶层跳都可以跳出当前的iframe,下面两种方法都可以跳出去

<script language="javascript">
window.parent.frames.location.href="${pageContext.request.contextPath}/jsps/personal/demandAcceptApply.jsp";
</script>
<script language="javascript">
top.location.href="${pageContext.request.contextPath}/jsps/personal/demandAcceptApply.jsp";
</script>

猜你喜欢

转载自blog.csdn.net/kxj19980524/article/details/86007836
今日推荐