Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If your IFRAME is on a different domain, you're essentially out of luck. Same-Domain security I believe plays a role here, and were you able to IPC in javascript with IFRAMES, you could launch all sorts of nasty attacks. People who have working implementations of site-sharing have to utilise proxy servers to relay messages between domains to get around browser security. </p> <pre><code> # works. $('body').append($(document.createElement('iframe')).attr('src','http://google.com')); # undefined $('iframe').contentWindow # undefined $('iframe').get(0).contentWindow # empty array $('iframe').contents() </code></pre> <p>I also thought I'd point out some grievous design nasties in the pasted code. </p> <ol> <li>Formatting DOM elements by gluing strings together.</li> <li>Creating DOM elements by gluing strings together.</li> </ol> <p>Goodness only understands what this does:</p> <pre><code>var style = '#div' + z + ' style: ' + 'display:block; width:' + $(this).outerWidth( true ) + 'px; height:' + $(this).outerHeight( true ) + 'px; position:absolute; top:' + $(this).position().top + 'px; left:' + $(this).position().left + 'px; cursor:pointer; z-index:' + $(this).parentNumber() + ';'; </code></pre> <p>Its a recipe waiting for XSS. Instead, this is recommended.</p> <pre><code> # Create a HashMap of keys-values instead of a string. var style = { display: 'block', width: $(this).outerWidth( true ) + 'px', height: $(this).outerHeight(true) + 'px', position: 'abosolute', top: $(this).position().top + 'px', left: $(this).position().left + 'px', cursor: 'pointer', 'z-index': $(this).parentNumber() }; var div = document.createElement('div'); $(div).attr({ name:'maskBox', id: 'div' + z }); $(div).addClass( $(this).attr("id") ); $(div).css(style); $(div).html('&amp;nbsp'); $("#createdDivs").append(div); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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