2014-09-29 91 views
3
<iframe src="http://astore.amazon.com/itbumobile-20?wmode=transparent" width="100%" height="6000" frameborder="0" scrolling="no"></iframe> 

在此iframe新链接在父窗口内打开。是什么导致iframe在父窗口内打开新链接?

<iframe src="http://www.w3schools.com" width="100%" height="6000" frameborder="0" scrolling="no" wmode="Opaque"></iframe> 

在这个iframe的新链接不是父窗口内开幕。

但是两个iframe编码似乎是相同的方式。不同行为的实际技巧是什么?

回答

1
<a href="http://en.wikipedia.org" target="_top">Top</a> 

<a href="http://en.wikipedia.org" target="_self">Self</a> 

target神奇:http://jsfiddle.net/DerekL/wxcufehg/

+0

但在这两个iframe内没有目标。此外,目标不会出现在iframe的链接中。但是两个iframe的行为不同。 – 2014-09-29 05:30:47

+1

@AsifIqbal - 如果你看看w3school的来源,你可以看到他们确实使用'target =“_ top”',例如:'Learn HTML' – 2014-09-29 05:32:39

+0

是的,它用于链接标签。但我正在寻找iframe标签 – 2014-09-29 05:34:02