 <p>I'd set up a message listener in B, and send a message from A. You'll need to attach to a window or compatible object, in B.js:</p> <pre><code> window.addEventListener('message', function (event) { try { var data = JSON.parse(event.data); // Do whatever } catch (exception) { // Didn't work } } ); </code></pre> <p>In A.js:</p> <pre><code>// This you could call on some event and provide the parameters function update(uname, pwd, fname, lname, dob, gend) { if (window.opener) { var data = { 'uname':uname, 'pwd':pwd, 'fname':fname, 'lname':lname, 'dob':dob, 'gend':gend }; window.opener.postMessage(JSON.stringify(data), '*'); } } </code></pre> <p>So in this case, the window running a script B.js needs to open another window running A.js.</p>