2014-09-29 90 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