title: Call Javascript Function in Child iFrame with Cross Domain site but Same location JS file
body: <p>I am trying to do the following:</p>
  
  <p>Main document calls a function in iFrame whose <strong>URL is from a different location</strong> but the Javascript function I'm trying to call loaded from the <strong>same domain as the main document</strong>.</p>
  
  <p>Is there any way to do this?</p>
  
  <p>To clarify:</p>
  
  <ul>
  <li>Main document: <strong>http://www.main.com</strong></li>
  <li>iFrame document: <strong>http://www.example.com</strong></li>
  <li>JS function i'm calling in iFrame is at <strong>http://www.main.com/js/script.js</strong></li>
  </ul>
  
  <p>I'm getting </p>
  
  <pre><code>Permission denied to access property 'js_function'
  </code></pre>
  
  <p>When doing</p>
  
  <pre><code>document.getElementById("iframe").contentWindow.js_function(n)
  </code></pre>