【问题标题】:dont change iframe source when click on F5(refresh)单击 F5(刷新)时不要更改 iframe 源
【发布时间】:2013-01-07 17:21:28
【问题描述】:

我有一个 iframe,它应该根据链接向我显示页面。

iframe 代码是:

<iframe width=940px onload=reSize() src="src/HEB/registerHEB.html" id="ifrm" name="iframe_main" frameborder="0" scrolling="no"></iframe>

当我点击这个链接时,我想这样做

<a href="html/guides.html" target="iframe_main">

它会在 iframe 中打开页面,但是当我点击 F5(刷新)时,它不会加载 iframe 的原始 src,而是我点击的最后一个链接。

非常感谢。

【问题讨论】:

  • 如果有办法解决它,为什么不呢。我试图制作一个 javascript 函数来更改 iframe 的 src。但是当我刷新页面时,它仍然返回原始 src。

标签: html iframe


【解决方案1】:

在 iframe 之后使用此脚本与:

<iframe src="src/HEB/registerHEB.html" id="ifrm" ......></iframe>
<script>
document.getElementById("ifrm").src = 'src/HEB/registerHEB.html'; 
</script>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-05-16
    • 2012-01-25
    • 1970-01-01
    • 1970-01-01
    • 2020-11-12
    • 2018-03-14
    • 1970-01-01
    • 2011-12-06
    相关资源
    最近更新 更多