I am trying to access a popup via JavaScript and write some content to a certain div.
This should be relatively easy, however for some reason it does not work.
At some point in my script I execute the following code:
var x = window.open('report_handle/test.html', "Popup", "width=300,height=300");
x.document.getElementById('test_id').innerHTML = '<br>Some new content!';
The HTML is as follows:
<!DOCTYPE html>
<html>
<body>
<div id="test_id"></div>
</body>
</html>
I get the following error by using firebug:
TypeError: x.document.getElementById(...) is null
x.document.getElementById('test_id').innerHTML = '<br>Some new content!';
Some new content!';` does it work? i don't think you can assign a variable to the `window.open` method – Paul Fitzgerald Aug 18 '16 at 16:48