Jump to content

Slowing down window.opener.location.reload()


joemorris86

Recommended Posts

I was using the following code to close my popup window

<a href="java script:self.close()">Close window</a>

and I wanted it to refresh the parent page when Close window was clicked.I found this example, which works but it automatically closes my popup rather than letting me click on Close window.Does anyone know how I can make this code only close and reload my parent page when I click the close link ?

window.close();if (window.opener && !window.opener.closed) {window.opener.location.reload();}

Thanks guys

Link to comment
Share on other sites

Do you mean something like this? sorry This is the first javascript I have ever done so Im a bit clueless. This doesn't close my popup.

<script language="JavaScript"><!--function closerel() {	window.close();if (window.opener && !window.opener.closed) {window.opener.location.reload();}//--></script><a href="java script:closerel()">Close window</a>

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...