Suppose I open a new window using:
newWindow = window.open(newUrl)
var ul = newWindow.document.getElementsByTagName("ul")[0];
ul.innerHTML = "new content";
However, this doesn’t modify the DOM of the new window at all..
Is there a way to do what I want to do? which is modify the DOM of a new window opened thru window.open?
Note that the last 2 lines work if I put it in the js for the opened page, so there’s nothing wrong with my DOM manipulation code.
It is possible assuming the new window you are opening belongs on the same domain as the opener. If not you cannot modify its DOM for security reasons as you are violating the same origin policy.