try { var topWindow = window.top; if (!topWindow.h5_init) { topWindow.h5_init = true; var links = [ 'https://securepubads.g.doubleclick.net', 'https://handball4all.h5v.eu/' ]; var scripts = [ {'url': 'https://handball4all.h5v.eu/latest/moli_es5.js', 'async': 1, 'nomodule': 1}, {'url': 'https://handball4all.h5v.eu/latest/moli.mjs', 'async': 1, 'type': 'module'} ]; for (var i = 0; i < links.length; i++) { var linkTag = topWindow.document.createElement('link'); linkTag.rel = 'preconnect'; linkTag.crossorigin = 'anonymous'; linkTag.href = links[i]; topWindow.document.head.appendChild(linkTag); } /* for (var i = 0; i < scripts.length; i++) { var scriptTag = topWindow.document.createElement('script'); scriptTag.async = true; scriptTag.src = scripts[i]; topWindow.document.head.appendChild(scriptTag); } */ for (key in scripts) { var scriptValue = scripts[key]; var scriptTag = topWindow.document.createElement('script'); if(scriptValue.async === 1) scriptTag.async = true; if(scriptValue.nomodule === 1) scriptTag.noModule = true; if(scriptValue.type !== undefined && scriptValue.type !== '') scriptTag.type = scriptValue.type; scriptTag.src = scriptValue.url; topWindow.document.head.appendChild(scriptTag); } } } catch (e) { console.error('failed to initialize.', e); }