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;​

```
You can reach main page with parent command (parent is the window) after the step you can make everything...

```
    function funcx() {
        var result = confirm('bla bla bla.!');
        if(result)
            //parent.location.assign("http://localhost:58250/Ekocc/" + document.getElementById('hdnLink').value + "");
            parent.location.assign("http://blabla.com/" + document.getElementById('hdnLink').value + "");
    } 

```