0

I have below webpage

<frameset rows = "10%,*">
      <frameset>
      <frame src="top_1.html" name = "top" id = "top" >
      </frameset>
        <frameset cols = "50%,50%">

        <frame src="leftFrame.html" name = "left" id = "left">
        <frame src="rightFrame.html" name = "right" id = "right">
      </frameset>

</frameset>

there is a function in both left and right frames , I want to call that functions from top frame.

I tried with parent.left.functionName; parent.right.functionName;

and it works fine with InternetExplorer , but when I open webpage in Chrome, it throws below error:

Uncaught DOMException: Blocked a frame with origin "null" from accessing a cross-origin frame.

Can anyone help me out, what wrong with my code.

I tried with document.getElementById("left").functionname() but no luck

Thanks in advance

abc
  • 1
  • 1
  • 3
  • 1
    Possible duplicate of [SecurityError: Blocked a frame with origin from accessing a cross-origin frame](https://stackoverflow.com/questions/25098021/securityerror-blocked-a-frame-with-origin-from-accessing-a-cross-origin-frame) – Ravi Ranjan Aug 22 '17 at 05:14
  • postMessage is possible .. https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage – joopmicroop Aug 22 '17 at 05:15
  • Thanks for your reply, can we call function of another frame using postMessage ? – abc Aug 22 '17 at 05:33

0 Answers0