【发布时间】:2010-07-25 17:06:52
【问题描述】:
我刚刚注意到针对 iFrame 的 JavaScript 历史记录控件正在影响父级。代码是:
document.getElementById('iframeid').contentWindow.history.back(-1);
document.getElementById('iframeid').contentWindow.history.forward(-1);
它工作正常,直到 iframe 中没有任何东西可以后退或前进,然后它会影响父框架来回移动,这发生在所有主要浏览器、safari、opera、chrome、firefox、即 6 7 8。
有人知道如何阻止它吗?
【问题讨论】:
标签: javascript