Monday, May 23, 2011

auto refresh parent page after close popup page.

1. place this code in child / pop-up page



function refreshParent(){ window.opener.location.href = window.opener.location.href;
if (window.opener.progressWindow) { window.opener.progressWindow.close() }
window.close();
}


2. Place a button to call the above JavaScript function at the bottom of the pop-up window, so when user clicks on the button, it’ll refresh the parent window and closes itself.





<input type=button value=”Close” onClick=”refreshParent();”/>

No comments: