Javascript – How to pass data to parent window from popup window

javascriptjquerypopup

How can I pass some data or call a function on the parent window from a popup window?

The user will click a link which will open a popup on the same website, once he is finished with the popup, I want it to send the new data back to the parent window, or call a function on the parent window.

Best Answer

The window.opener object is what you're looking for, used it from within your popup like so to call the a function of the parent window:

window.opener.yourFunc()