Hello,

I would like to draw your attention on what seems to me to be a bug in IE6.

It regards the call of a function from a popup. Say a link on page.html allows you to open popup.html ; popup.html contains a link that can trigger javascript functions in page.html. If you want to refresh page.html from popup.html, using the classical "location.reload()" inside a function DOESN'T WORK. I get the following javascript error: "Variable uses an Automation type not supported in JScript".

The following code doesn't work:

page.html
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>
	<title>Untitled</title>
</head>
<script language="JavaScript">
function reloadIt() {
	location.reload();
}
</script>
<body>
<a href="javascript://" onclick="window.open('popup.html','popup','width=200,height=200')">Open the popup</a>
</body>
</html>
popup.html
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
	<title>Untitled</title>
</head>
<script language="JavaScript">
function clicky() {
	window.opener.reloadIt();
	window.close();
}
</script>

<body>
<a href="javascript://" onclick="clicky()">Refresh the parent</a>


</body>
</html>
This does of course work with IE5, IE5.5, Mozilla and NN6.

The following doesn't work either:
"window.location.href = window.location.href;"
"document.location.reload();"

(still, all that works with Mozilla)

FIX: use history.go(). The following does work:

Code:
<script language="JavaScript">
function reloadIt() {
	window.history.go(0);
}
</script>
That would have saved me a lot of time...

Anyways, if anyone can explain to me what went wrong, please do so; otherwise, well, have a nice one!