Refreshing Parent window when Pop Up window is closed in Java Script

Open a pop-up:

We have two very easy and common way of opening a new window in JavaScript.

1. Using winodw.Open() method.

window.open("http://expressdotnet.blogspot.in/","","width=200,height=100");

2. Using window.showMModalDialog() method.

window.showModalDialog("http://expressdotnet.blogspot.in/", "", "dialogHeight: 481px; dialogWidth: 718px;")


Refresh Parent window:

1. When using window.open() method, we get reference of parent window from window.opener property.
use window.opener.location.reload() method to refresh parent window.

2. When using window.showModalDialog() method, new window opens as a modal dialog and execution of code of parent window stops until pop-up gets closed.
we can use this behaviour and can call window.location.reload() method, just after line window.showModalDialog().