title: Call parent Javascript function from inside an iframe
body: <p>I have a iframe (in my domain), that iframe has a file <code>iframe.js</code>.</p>
  
  <p>My parent document has a file <code>parent.js</code>.</p>
  
  <p>I need to call a function that is in <code>parent.js</code>, from a function that is in <code>iframe.js</code>.    </p>
  
  <p>I tried doing <code>window.parent.myfunction()</code> this function is in the <code>parent.js</code> file.</p>
  
  <p>But, it  didn't work. Only when I put the function on the parent page (I mean in the HTML), then it worked.     </p>
  
  <p>Any idea how to get this to work?</p>