次のHTMLを考えると、iframeのアンカータグが親ウィンドウをターゲットにすることは可能ですか?
<div>
<iframe src="/pageview.html"></iframe>
</div>
iframe(pageview.html)コンテンツ:
<a href="http://www.google.com">link</a>
次のHTMLを考えると、iframeのアンカータグが親ウィンドウをターゲットにすることは可能ですか?
<div>
<iframe src="/pageview.html"></iframe>
</div>
iframe(pageview.html)コンテンツ:
<a href="http://www.google.com">link</a>
target属性が必要です:
<a href="something" target="_parent">go</a>
を使用_parentすると、フレームの直接の親ウィンドウがターゲットになります。トップウィンドウをターゲットにするには、を使用します_top。
<div>
<iframe src="/pageview.html">
<a onclick="javascript:window.parent.location.href='http://www.google.com'; return false;">link</a>
</iframe>
</div>
そのようなものでなければなりません...