Javascript examples for Browser Object Model:Window opener
Using a variable from a different window
<html> <head> <script> function ShowData()/*from w w w. java2 s. c o m*/ { display("NewWindowData: " + this.NewWindowData); display("MainWindowData: " + window.opener.MainWindowData); } function display(msg) { var p = document.createElement('p'); p.innerHTML = String(msg); document.body.appendChild(p) } </script> </head> <body> <input type="button" value="Show Data" onclick="ShowData()"> </body> </html>