Reputation: 213
How can I navigate to a URL using JavaScript through IE, I have tried most of the functions for JavaScript, and they doesn't work for 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
Please I need help with that. Thank You.
EDIT!!!
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");
Upvotes: 1
Views: 1619
Reputation: 149
Try this :
<script language="javascript">
window.navigate("");
</script>
Or this :
<script language="JavaScript">
self.location="";
</script>
-Mohamed Shimran
Upvotes: 0
Reputation: 3334
try this
self.location=”top.htm”;
tested in IE6,IE7 All the methods below should work in actuality -
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”;
Upvotes: 1