javascript, reloading parent page when pop up closes. Why doesnt this work?

Associate
Joined
11 Oct 2008
Posts
268
Hey guys, Im trying to get some code together that will reload my main page when I click 'Close page' on my popup.

I put this together but its not working, does anyone have any ideas?

Code:
<script language="JavaScript">
<!--

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

//-->
</script>


<a href="javascript:closerel()">Close window</a>
 
Last edited:
is this code in the pop up? if your window is closed then how can it carry out any actions?
refresh the parent then close :)
 
Back
Top Bottom