javascript: passing arguments from popup to main window
By Anatoly Mironov
To show a popup, we just have to invoke “window.open”, and provide some options to prevent opening this in a new tab:
var wnd = window.open('', '\_blank', 'width=750, height=400, location=no, resizable=1, menubar=0, scrollbars=0');
wnd.document.write('');
wnd.document.close(); wnd.document.close(); wnd.focus();
To communicate between parent and child we can refer to parent as window.opener. We can even invoke a function from parent window. Let’s create the most useful function:
foo = function() { console.log("foo"); }
```Then just click on "hej" in the popup, and see the console. Next: [Using javascript objects passed from closed popup](/2012/06/19/using-javascript-objects-passed-from-closed-popup/)