Quickest way to pass data to a popup window I created using window.open()?

Due to security restrictions it is super easy only if the parent window and the popup are from the same domain. If that is the case just use this:

// Store the return of the `open` command in a variable
var newWindow = window.open('http://www.mydomain.com');

// Access it using its variable
newWindow.my_special_setting = "Hello World";

In the child (popup) window, you could access that variable like this:

window.my_special_setting

Was there something specific you wanted to do past that?

Leave a Comment