root = document.getElementById("even3-widget-ticket"); if (root == null) { alert("Div even3-widget-ticket not found"); } else { root.setAttribute("style", "width:100%;"); ifrm = document.createElement("IFRAME"); ifrm.setAttribute("src", "https://www.even3.com.br/widget/index?evento=inscricoes-notariado-jovem-363482&type=ticket&lang=pt"); ifrm.setAttribute("id", "even3_ticket"); 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_ticket').style.minHeight = messageData.message + 'px'; }, }, '#even3_ticket'); }; 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_ticket').style.minHeight = messageData.message + 'px'; }, }, '#even3_ticket'); }