HTML frame tag URL of browser not changing

旧时模样 提交于 2019-12-12 12:32:23

问题


How do I change the URL of the browser with a website using a structure of <frame>. I know the whole point of <frame> is to use embedded frames so that you can't tell where the site is going. In particular, when you click a link, the frame changes, but the URL at the top of the browser says the same thing.

I'm trying to make it so that the browser CHANGES the URL, so the real URL of the main inner frame is shown at all times. How can I do this?


回答1:


You can't; best bet is to change the fragment with JavaScript, e.g. window.location.hash = 'whatever'.

You will need to use JavaScript to then detect this and modify the frame's src attribute.




回答2:


Try to use a javascript to change window.location.hash, see this article : http://bytes.com/topic/javascript/answers/170365-change-browser-url-without-navigating-away

or this question How do I, with JavaScript, change the URL in the browser without loading the new page?



来源:https://stackoverflow.com/questions/5214717/html-frame-tag-url-of-browser-not-changing

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!