Can A.js call a function from B.js?
Can A.js modify the DOM of page B.html?
Yes, but you need a reference AND have the same origin.
If page A have a reference to page B, it is possible for A to modify the DOM in B.
// Open a new window
var myWindow = window.open("", "myWindow", "width=200, height=100");
// Write some text in the new window
myWindow.document.write("<p>This is 'myWindow'</p>");
// Write some text in the window that created the new window
myWindow.opener.document.write("<p>This is the source window!</p>");
Same Origin Policy Limitation
The same origin policy limit what you can access. If the 2 pages are on different domains, you will not be able to access the
window.document property to read or write. Here is a list of what you can access when the other page is from a different domain.