root = document.getElementById("even3-widget-speaker"); if (root == null) { alert("Div even3-widget-speaker not found"); } else { root.setAttribute("style", "width:100%;"); ifrm = document.createElement("IFRAME"); ifrm.setAttribute("src", "https://www.even3.com.br/widget/index?evento=iv_epava&type=speaker&lang=pt"); ifrm.setAttribute("id", "even3_speaker"); ifrm.setAttribute("frameborder", "0"); ifrm.setAttribute("vspace", "0"); ifrm.setAttribute("hspace", "0"); ifrm.setAttribute("marginheight", "0"); ifrm.setAttribute("marginwidth", "5"); ifrm.setAttribute("width", "100%"); root.appendChild(ifrm); } if (typeof iFrameResize == 'undefined') { var scr = document.createElement('script'), head = document.head || document.getElementsByTagName('head')[0]; scr.src = 'https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.6/iframeResizer.min.js'; scr.async = false; scr.onload = function () { iFrameResize({ scrolling: 'no', checkOrigin: false, log: false, minHeight: 200, heightCalculationMethod: 'bodyOffset', initCallback: function (iframe) { }, onMessage: function (messageData) { document.getElementById('even3_speaker').style.minHeight = messageData.message + 'px'; }, }, '#even3_speaker'); }; head.insertBefore(scr, head.firstChild); } else { iFrameResize({ scrolling: 'no', checkOrigin: false, log: false, minHeight: 200, heightCalculationMethod: 'bodyOffset', initCallback: function (iframe) { }, onMessage: function (messageData) { document.getElementById('even3_speaker').style.minHeight = messageData.message + 'px'; }, }, '#even3_speaker'); }