Get browser to redirect window from modalized content
I have content in a modalized window, and when a user clicks a link, I'd like to have the entire browser redirect, not just the modal window. This doesn't work, unfortunately.
Code I currently have:
<a onclick="window.location.href = 'http://insert/url/here'">morestuff!</a>
This only loads the url in the modal window. What can I do to get the whole window to load said url?
像这样的东西应该工作:
<a onclick="window.parent.location.href='http://insert/url/here'">morestuff!</a>
When you say "modalized" - do you mean a jquery dialog/IFrame window or a physically different browser window.
If it's the first case then you need a reference to the outer parent:
window.parent.location.href = "http://www...";
If it's the second one then you need a reference to the opener:
window.opener.location.href = "http://www...";
链接地址: http://www.djcxy.com/p/42200.html上一篇: 使用Chrome远程调试时,在Android中将新网址发送到Chrome
下一篇: 获取浏览器从模态化内容重定向窗口