I have a parent page that opens a child page (IE11).
I want to add some controls to the parent page, that triggers some functions in the child page.
This is the content of the parent page (simplified):
<script>
let newWindow = window.open('cannon.htm','Picture Display', 'width=780, height=520');
</script>
<button onclick="newWindow.actions.sayHello()">Say</button>
This is the content of the child page (simplified):
let actions;
window.addEventListener('load', function() {
actions = (function() {
return {
sayHello: function() {
console.log("hello");
}
}
})();
});
This throws an error. Why? How can I make it work?
THE ERROR: Unable to get property 'sayHello' of undefined or null reference