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