Hi there,
I’m having trouble with window.location in IE6 for a few days now.
I made an online file manager for my CMS. The JavaScript is used to redirect to a filehandler, based on the extension of the file one wants to open.
Last week I’ve been testing it in following browsers, and everything worked fine at that time:
-Internet Explorer 5.5
-Internet Explorer 6.0
-Internet Explorer 7.0 (through the updates of Microsoft)
-Mozilla Firefox 1.0
-Mozilla Firefox 1.5.0.7
-Mozilla Firefox 2.0.0.1
-Mozilla 1.8b
-SeaMonkey 1.0.6
-Netscape 8.0.2 (tested in both engines: IE and FF)
-Opera 8.0
-Opera 9.1
-K-meleon 1.02
-Konqueror 3.5.2
Yesterday I had to represent this to a client, and suddenly none of the commands seemed to work.
Because the whole script was rather long, and could contain an error that makes window.location do nothing, I did some research when I got home and made a test-page.
You should take a look at this documentation before giving me advice or solutions, because I think I tried it all…
-[I]window.[/I][B]navigate([/B][I]sURL[/I][B])[/B]
-location Object
This is the test-page:
<html>
<head>
<meta http-equiv=“Content-Type” content=“text/html; charset=iso-8859-1”>
<title>Untitled Document</title>
<script language=“javascript” type=“text/javascript”>
function OpenLocation()
{
window.location = ‘http://www.google.be’;
}
function OpenLocationHref()
{
window.location.href = 'http://www.google.be';
}
function OpenLocationIntern()
{
window.location = 'redirected.html';
}
function OpenLocationInternHref()
{
window.location.href = 'redirected.html';
}
function OpenNavigate()
{
window.navigate('http://www.google.be');
}
function OpenNavigateIntern()
{
window.navigate('redirected.html');
}
</script>
</head>
<body>
<a href=“javascript:;” onClick=“OpenLocation();”>Google</a><br/>
<a href=“javascript:;” onClick=“OpenLocationHref();”>Google HREF</a><br/>
<a href=“javascript:;” onClick=“OpenNavigate();”>Navigate Google</a><br/>
<a href=“javascript:;” onClick=“OpenNavigateIntern();”>Navigate Intern</a><br/>
<a href=“javascript:;” onClick=“OpenLocationIntern();”>Intern</a><br/>
<a href=“javascript:;” onClick=“OpenLocationInternHref();”>Intern HREF</a><br/>
<a href=“javascript:;” onclick=“window.location = ‘http://www.google.be’;”>Inline</a><br/>
<a href=“javascript:;” onclick=“window.location.href = ‘http://www.google.be’;”>Inline HREF</a>
</body>
</html>
This test-page works in all the browsers, except Internet Explorer 6.
I tried every doc-type, I tried every JavaScript version in the script-tag, I tried the script-tag without any attributes, I tried to enclose the JavaScript-code with <!-- –>, … you name it…
I’ve got serveral computers at hand, one has automatic updates disabled, so that computer did not receive any updates from Microsoft.
Even on the untouched IE6 this test-page doesn’t work.
All the other browsers have no problem with redirecting.
The window.location.reload(boolean) does work, and alert(window.location) works perfect too.
The weird thing about this whole thing is that none of the browsers give warnings, errors or whatever, not even IE6.
Anyone suggestions or maybe a solution?
Thankx,
Vince