window.location跳转页面
生活随笔
收集整理的這篇文章主要介紹了
window.location跳转页面
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
關于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頁面跳轉
總結
以上是生活随笔為你收集整理的window.location跳转页面的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 生成随机验证码
- 下一篇: jquery打开页面