I am getting this error with my code "Failed to execute 'write' on 'Document': It isn't possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened."
I am trying to load every 25 seconds new ad banner from third site.
mFl();
function mFl() {
if (document.getElementsByClassName('adposition').length > 0) { loadMe("adposition","http://third.tld/b?z=1&u=a&width=728&height=90"); }
setTimeout(mFl, 25000);
}
function loadMe(className, scriptName) {
var docHeadObj = document.getElementsByClassName( className )[0];
docHeadObj.innerHTML = "";
var ttt = Math.floor(Date.now() / 1000);
var dynamicScript = document.createElement("script");
dynamicScript.type = "text/javascript";
dynamicScript.src = scriptName+ "&uunique=" + ttt;
docHeadObj.appendChild(dynamicScript);
}
Any workaround for this please?