var hostname = 'easymailing.eu'; var loaderScriptId = 'easi-plugin-loader'; // you could encode the css path itself to generate id.. if (!document.getElementById(loaderScriptId)) { var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.id = loaderScriptId; script.type = 'text/javascript'; script.src = '//' + hostname + '/frontend/easiplugin.php?load'; head.appendChild(script); } else { if (typeof loadframe !== "function") { loadframe = function(){}; } loadframe(); }