Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Please see this post and my answers: <a href="https://stackoverflow.com/questions/2161388/iframe-function-calling-from-iframe-to-parent-page-javascript-function/9359230#9359230">Calling a parent window function from an iframe</a></p> <p>It is possible, but not easy. You have to hack about a bit to get it to work.</p> <p>I believe that, because you have access to the framed domain and frame page domains, you will be able to use the document.domain-in-the-head trick.</p> <pre><code>&lt;script&gt; document.domain = "mydomain.com"; &lt;/script&gt; </code></pre> <p>Update:</p> <p>Can I just check the following?:</p> <ol> <li><p>Have you put the document.domain <code>&lt;script&gt;</code> in the head of both pages?</p></li> <li><p>Do both have the exact same string, i.e. both have <code>"subdomain.mydomain.com"</code> or both have <code>"mydomain.com"</code>? Typically you use this to ensure that the framed page has the same document domain as the parent.</p></li> <li><p>Do you still get a security error after calling a parent function from the framed page?</p></li> <li><p>If not, this is the function I use to resize my frame. It is located in the head of the framed page.</p> <pre><code>window.ResizeFrame = function (newHeight) { if (window.parent &amp;&amp; window.parent.document) { var $frame = $(window.parent.document).find("#frame-id"); if ($frame.length) { if (typeof (newHeight) === "number") { $frame.css("height", newHeight); } } } }; </code></pre></li> </ol> <p>Let me know how it goes!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload