Jump to content

[SOLVED] Auto refresh parent page when close popup


dc_jt

Recommended Posts

Ive tried searching for this but still cant seem to get my page to refresh.

 

Here is my setup.

 

Page 1 contains the following link:

<a href="#" style="cursor:pointer" onclick="MM_openBrWindow('/cms/_content/documents/upload-document.inc.php?iDocumentId=<?=$_GET['iDocumentId']?>&iCategoryId=<?=$_GET['iCategoryId']?>','cardimg','width=800,height=300')">Upload Document</a>

 

This opens page 2 as a popup window.

 

In page 2 I have the following to close the popup:

<a onclick="JavaScript:refreshParent()" href="#">Close</a>

 

And also have the following javascript within page 2:

<script language="JavaScript">
<!--
function refreshParent() {
  window.opener.location.href = window.opener.location.href;

  if (window.opener.progressWindow)

{
    window.opener.progressWindow.close()
  }
  window.close();
}
//-->
</script>

 

This closes the popup but doesnt refresh page 1, any ideas why??

 

Thanks

 

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.