Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refresh a parent page in IE 1

Status
Not open for further replies.

abienz

Programmer
Aug 13, 2001
53
0
0
GB
Hi guys, hopefully this is simple but I've had no luck so far.

What I want to do is to refresh or reload the parent page from a child page,

Eg. I've got a popup window that does something, when it finishes I want the parent window to refresh, here's my code so far...
Code:
opener.location.reload;window.close();

This code is written into the page by Response,Write from my ASP code, I shouldn't think this would make a difference though right? I've checked it in MZ and it works fine.

Any help would be cool

Alex.
 
Try:

<script language=&quot;JavaScript&quot;>
<!--
function refreshParent()
{
window.opener.location.href = window.opener.location.href;
window.close();
}
//-->
</script>


 
Q for you hrothenb - does setting the opener's location.href to itself prevent the dreaded &quot;Form Resubmit Error&quot;?

For me on pages where the parent is a lookup form, I have always encountered an error in IE when I try to do the &quot;window.opener.location.reload();&quot; I've gotten around it by having a function on the opener page called Save() like the following:

Code:
function Save()
{
  document.form[0].submit();
}
and the closing function in the popup calls this:
Code:
window.opener.Save();
That way if I need to pass values from the popup to the opener, I have a good mechanism in place already. But it might be overkill, esp. for pages that don't have a form to submit.

Just curious, because I've had to invent workarounds for this very issue.

Einstein47
(&quot;The pure and simple truth is rarely pure and never simple.&quot; - Oscar Wilde)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top