如何通过 IE 使用 JavaScript 导航到 URL,我已经尝试了 JavaScript 的大部分功能,但它们不适用于 IE。
window.location.href = ''; //doesn't work for IE
window.location = ''; //doesn't work for IE
window.open(""); //does work for IE but it opens it in a new tab and I don't want this
请帮我解决这个问题。 谢谢。
编辑!!!
window.location.href = ''; //works well for IE, the problem was that I was using jQuery to build my HTML and solved by: jQuery.mobile.navigate("url.html#subPg");
最佳答案
试试这个
self.location=”top.htm”;
在IE6、IE7下测试 下面的所有方法在现实中都应该有效 -
1,
window.location.href=”login.jsp?backurl=”+window.location.href;
2,
window.history.back(-1);
3,
window.navigate(”top.jsp”);
4,
self.location=”top.htm”;
5,
top.location=”error.jsp”;
关于javascript - 如何通过 IE 使用 JavaScript 导航到 URL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20952541/