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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reload parent window

Status
Not open for further replies.

Kendel

Programmer
Apr 24, 2002
1,512
US
Hello,

I have the parent window is a frame. By clicking on a href of this window, another window will popup. After the changes are saved, the popup window will close and the parent window will be reloaded.

The thing is I can only do this once. The second time I do it the parent window couldn't reload. It just hangs there forever.... (blank screen)

Here is the script I use:

Code:
<input type="button" value="Save" onClick="SubmitForm();>

<script language="JavaScript">
function SubmitForm() {
  document.form1.submit();
  window.opener.location.reload();
  window.close();	
}
</script>
Can someone please show me how to get it work?

Thanks

-kendel
 
Try:

Code:
<script language="JavaScript">
function SubmitForm() {
  document.form1.submit();
  window.opener.location.reload();
  [b]opener = self;[/b]
  window.close();    
}
</script>

'hope that helps. If it doesn't, please post more code.

--Dave
 
Thanks but I got same error, parent window is unable to reloaded.

-kendel
 
Ok, I found where the problem was.

I hadwindow.close() right after window.opener.location.reload()

The parent window didn't have enough time to reload but the popup was already closed. So what I need is to pause before closing the popup.

setTimeout("window.close()", 30);

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top