【发布时间】:2020-02-18 22:12:43
【问题描述】:
我正在使用 iframe 在我的程序中加载第二个网站。
我为此目的创建了带有 iframe 的 div:
<div id='ktmv-help'>
<iframe id="contextHelp" allowTransparency="true" scrolling="no"
frameborder="0">
</iframe>
</div>
当我在程序的页面之间导航时,我正在使用 $('#contextHelp')[0].contentWindow.location.replace(url); 命令以编程方式更改 iframe 的内容。
问题是通过$('#contextHelp')[0].contentWindow.location.replace(url); 命令更改内容后,我无法返回 iframe 的上一页。
我尝试了history.back()、window.history.back()、history.go(-1) 命令,但它们都不起作用。我看到相同的 iframe 页面。
【问题讨论】:
标签: javascript iframe browser-history