javascript - 是什么导致 iframe 在父窗口中打开新链接?

标签 javascript html iframe

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

在此 iframe 中,新链接在父窗口内打开。

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

在此 iframe 中,新链接不会在父窗口内打开。

但是两个iframe的编码方式好像是一样的。不同行为的实际技巧是什么?

最佳答案

<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/

关于javascript - 是什么导致 iframe 在父窗口中打开新链接?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26092961/

相关文章:

javascript - Plupload 文件名问题

javascript - 如何扩展单个文件?

javascript - 根据属性值选择元素

javascript - 设置相对于宽度的高度

javascript - XMLHttpRequest() 不会从我的 node.js/express 渲染 View ?

javascript - jQuery在克隆选择选项后获取数据id

html - 页脚不在页面底部,而是在背景图像的底部

html - 如何使我的下拉菜单 block 在父元素 block 下居中对齐?

javascript - 如何使用仪表板在WordPress中插入iframe

javascript - Google Chrome - 使用 iframe 时屏幕捕获失败,相同的脚本在没有 iframe 的情况下工作