关于js中"window.location.href"、"location.href"重定向

2022-10-09,,,,

关于js中"window.location.href"、"location.href"、"parent.location.href"、"top.location.href"的用法

"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页面跳转

 

原文链接:https://blog.csdn.net/natian306/article/details/21527369

《关于js中"window.location.href"、"location.href"重定向.doc》

下载本文的Word格式文档,以方便收藏与打印。