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

 

 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.