[英]How to change the URL in browser due to the navigation at iframe?
我想根據iframe導航更改瀏覽器中的URL,如:
**[URL at navigator: http://localhost/]**
<html>
<body>
<iframe src="http://localhost/?loadiframe=true">
<!-- this is at the code retrieved by the iframe -->
<a id="mypage" href="http://localhost/mypage/?loadiframe=true">Navi</a>
</iframe>
</body>
</html>
當用戶單擊#mypage鏈接時,瀏覽器中的URL將為:
http://localhost/mypage/
並不重要的是iframe的src總是一樣的。
那可能嗎?
也許使用ajax ......... ??
看看: Html5歷史api
如果將鏈接的target
屬性設置為_parent
,則該地址應在父窗口中打開:
<a id="mypage" href="http://localhost/mypage/?loadiframe=true" target="_parent">Navi</a>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.