I have two frames, named mybinf and mymainf, that loads x.html and b.html, respectively. In x.html I have this javascript code to load a video into mymainf. The javascript works in Firefox and does not in Google chrome. The latter causes the exception, "Uncaught DOMException: Blocked a frame with origin "null" from accessing a cross-origin frame" at the line "var mframe = ...". How to fix this or how to write code that is cross browser compatible?
<div id="mysidenav" class="sidenav">
<div id="myinterface" class="interface">
<div id="mybind" class="bindiv">
<iframe id="mybinf" class="BinFrame" src="html/x.html" frameborder="no"></iframe>
</div>
</div>
</div>
<div id="mymain" class="main">
<iframe id="mymainf" class="MainFrame" src="html/b.html" scrolling="no"></iframe>
</div>
In x.html:
function loadbinquest() {
var site = "images/next.png";
var mframe = parent.frames['mymainf'];
mframe.src=site;
}