Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<ol> <li><p><strong>Turn the <code>embed</code> elements into <code>iframe</code> elements, don't forget the close tags.</strong></p> <p>The <a href="http://www.w3.org/TR/html5/the-iframe-element.html#the-embed-element" rel="nofollow">W3 - Technical Review - HTML 5 - The <code>embed</code> element</a> mentions</p> <blockquote> <p>The embed element represents an integration point for an external (typically non-HTML) application or interactive content.</p> </blockquote> <p>so you should rather use <code>iframe</code> elements instead of <code>embed</code> elements, <a href="http://www.w3.org/TR/html5/the-iframe-element.html#the-iframe-element" rel="nofollow">which</a> mentions:</p> <blockquote> <p>The iframe element represents a nested browsing context.</p> </blockquote> <p>in which <a href="http://www.w3.org/TR/html5/browsers.html#browsing-context" rel="nofollow">a browsing context is defined</a> as:</p> <blockquote> <p>A browsing context is an environment in which Document objects are presented to the user.</p> </blockquote></li> <li><p><strong>You can declaring a global variable in a script you use in the main page.</strong></p> <p>It is as simple as <code>var myvariable;</code></p></li> <li><p><strong>You can access the variable from within an iframe using <code>window.parent.myvariable</code>.</strong></p> <p><a href="https://developer.mozilla.org/en/DOM/window.parent" rel="nofollow">The DOM object <code>window.parent</code> is defined</a> as such:</p> <blockquote> <p>Returns a reference to the parent of the current window or subframe.</p> <p>If a window does not have a parent, its parent property is a reference to itself.</p> <p>When a window is loaded in an <code>&lt;iframe&gt;</code>, <code>&lt;object&gt;</code>, or <code>&lt;frame&gt;</code>, its parent is the window with the element embedding the window.</p> </blockquote> <p>A shortened version is to use <code>parent.myvariable</code>, as <code>window</code> is the root DOM object.</p></li> <li><p><strong>Make sure that the domains, protocols and ports of the different documents match.</strong></p> <p>Unless you want to be presented with a nasty error like:</p> <blockquote> <p>Unsafe JavaScript attempt to access frame with URL X from frame with URL Y.<br> Domains, protocols and ports must match.</p> </blockquote></li> </ol>
 

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