function generateIFrame() { var aScripts = document.getElementsByTagName( 'script' ); var aScript = null; for (var i = 0; i < aScripts.length; ++i) { if( isEmbedScript(aScripts[i])){ aScript = aScripts[i]; } } if (aScript == null) { var aScript = aScripts[ aScripts.length - 1 ]; } if (aScript !== null) { var aWrapper = aScript.parentNode; var aURL = "https://heartcert.mytasystem.com:443/ittrium/embed/A1x6fx1x66y1xdbdcx1x67y1xe1efx1x76?id=1&theme=embed&cookie=cid:258711"; var aIFrame = document.createElement('iframe'); aIFrame.setAttribute('src', aURL); aIFrame.setAttribute('width', '100%'); aIFrame.setAttribute('scrolling', 'no'); aIFrame.setAttribute('frameBorder', '0'); aWrapper.appendChild(aIFrame); } } function isEmbedScript(aScript){ return aScript.getAttribute('id') === "cid258711"; } function loadScript( url, callback ) { var script = document.createElement( "script" ); script.type = "text/javascript"; if(script.readyState) { script.onreadystatechange = function() { if ( script.readyState === "loaded" || script.readyState === "complete" ) { script.onreadystatechange = null; callback(); } }; } else { script.onload = function() { callback(); }; } script.src = url; document.getElementsByTagName( "head" )[0].appendChild( script ); } var aDomain = "https://heartcert.mytasystem.com:443"; var aIFrameResizerScript = '/site/other/iframe-resizer/js/iframeResizer.js'; var aFrameResizerScript = aDomain + aIFrameResizerScript; generateIFrame(); loadScript(aFrameResizerScript, function() { iFrameResize({ log: true, checkOrigin: false }); });