I am opening a popup window (JSP page) using JavaScript.
I am setting some value in the popup and doing window.close().
Now, I am to return that value to the main page from where I had opened the popup through JavaScript.
How can I retrieve the value?
In your jsp page add this :
function onPopupClose(returnParameter) {
// Process returnParameter here
}
window.open('popup.jsp?parameter='+param,'mywindow','width=500,height=350,toolbar=no,resizable=no,menubar=no');
Then in your popup jsp, before calling window.close , add this line :
window.opener.onPopupClose(myValue);//myValue is the value you want to return to main javascript
window.close();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With