Question: I opened a popup window by window.open in JavaScript, I want to refresh parent page when I close this popup window.(onclose event?) how can I do that?

```
window.open("foo.html","windowName", "width=200,height=200,scrollbars=no");

```

Answer: 
window.open will return a reference to the newly created window, provided the URL opened complies with [Same Origin Policy](http://www.mozilla.org/projects/security/components/same-origin.html). 

This should work:

```
function windowClose() {
    window.location.reload();
}

var foo = window.open("foo.html","windowName", "width=200,height=200,scrollbars=no");
foo.onbeforeunload= windowClose;​

```
**Try this**

```
        self.opener.location.reload(); 

```

> 
> Open the parent of a current window and reload the location.
> 
> 
>