public/javascripts/nodegame-full.js
function completed(event) {
            var iframeDoc;

            // IE < 10 (also 11?) gives 'Permission Denied' if trying to access
            // the iframeDoc from the context of the function above.
            // We need to re-get it from the DOM.
            iframeDoc = J.getIFrameDocument(iframe);

            // readyState === "complete" works also in oldIE.
            if (event.type === 'load' ||
                iframeDoc.readyState === 'complete') {

                // Detaching the function to avoid double execution.
                iframe.detachEvent('onreadystatechange', completed );
                iframeWin.detachEvent('onload', completed );

                if (cb) {
                    // Some browsers fire onLoad too early.
                    // A small timeout is enough.
                    setTimeout(function() { cb(); }, 120);
                }
            }
        }
function completed(event) {
            var iframeDoc;

            // IE < 10 (also 11?) gives 'Permission Denied' if trying to access
            // the iframeDoc from the context of the function above.
            // We need to re-get it from the DOM.
            iframeDoc = J.getIFrameDocument(iframe);

            // readyState === "complete" works also in oldIE.
            if (event.type === 'load' ||
                iframeDoc.readyState === 'complete') {

                // Detaching the function to avoid double execution.
                iframe.detachEvent('onreadystatechange', completed );
                iframeWin.detachEvent('onload', completed );

                if (cb) {
                    // Some browsers fire onLoad too early.
                    // A small timeout is enough.
                    setTimeout(function() { cb(); }, 120);
                }
            }
        }
function completed ( event ) { var iframeDoc ; // IE < 10 (also 11?) gives 'Permission Denied' if trying to access // the iframeDoc from the context of the function above. // We need to re-get it from the DOM. iframeDoc = J . getIFrameDocument ( iframe ) ; // readyState === "complete" works also in oldIE. if ( event . type === 'load' || iframeDoc . readyState === 'complete' ) { // Detaching the function to avoid double execution. iframe . detachEvent ( 'onreadystatechange' , completed ) ; iframeWin . detachEvent ( 'onload' , completed ) ; if ( cb ) { // Some browsers fire onLoad too early. // A small timeout is enough. setTimeout ( function ( ) { cb ( ) ; } , 120 ) ; } } }
We cannot get the iframeDoc here and use it in completed. See below.
We cannot get the iframeDoc here and use it in completed . See below .