0
我是新的HTML iframes。点击浏览器后退按钮加载两个iframe
我的HTML代码如下所示。
index.html
<html>
<head>
<script type="text/javascript">
function change(content,content2) {
top.iframe_b.location.href = content2;
top.iframe_a.location.href = content;
}
</script>
</head>
<body>
<div class="container">
<a title="" href="#" onclick="change('a.html','b.html')"><div class="smallbox">Click meee</div></a>
<div style="width: 30%; height: 100%; float:left">
<iframe id="iframe_a" src="home.html" height="100%" width="100%" name="iframe_a"></iframe>
</div>
<div style="width: 70%; height: 100%; float:right">
<iframe id="iframe_b" src="dash.html" height="100%" width="100%" name="iframe_b" style="border-left: solid; border-left-color: black"></iframe>
</div>
</div>
</body>
当我在链接Click meee
点击则两个I帧iframe_a
和iframe_b
将分别呈现a.html
和b.html
页这是罚款。
但是,当我点击浏览器的后退按钮,那么它只改变iframe_a
加载home.html
。但iframe_b
没有变化。 (广告最后更改href在javascript代码中为iframe_a
)
然后在第二次点击时,它将更改iframe_b
并将其加载到dash.html
中。
我希望iframes
只有一次点击浏览器的后退按钮才能切换到最后一页。
如果可能或任何其他解决方案也将不胜感激,请就此建议。
我可以通过点击浏览器的后退按钮加载最后一页吗?我不认为它可能与那个 – AmanS
jquery load()异步工作,所以你的index.html甚至不改变你的位置,但正如我前面提到,如果你想做任何改变,你可以通过使用一些JS代码来实现这一点。如果您希望在操作后显示/隐藏某些内容,例如点击,您可以通过多种方式进行操作。 – 3squad