<a href="666.html" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" target="_top">
<a href="666.html" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" target="_parent"> 讓它連結目标為父架構就可以了
背景
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頁面跳轉
連結或者form
D頁面中有form
<form>: form送出後D頁面跳轉
<form target="_blank">: form送出後彈出新頁面
<form target="_parent">: form送出後C頁面跳轉
<form target="_top"> : form送出後A頁面跳轉
parent.location.reload():C頁面重新整理
window.opener.document.location.reload():C頁面重新整理(使用子視窗的opener對象來獲得父視窗對象)
top.location.reload():A頁面重新整理