(function(){ var el = document.getElementById('1509959267243'); el.innerHTML = ""; var scripts = el.getElementsByTagName('script'); for (var i = 0; i < scripts.length; i++) { var parentDiv = scripts[i].parentNode; var markerEl = document.createElement('div'); var dateId = new Date(); var markerElId = dateId.getTime(); markerEl.id = markerElId; parentDiv.insertBefore(markerEl, scripts[i]); var scriptAtts = scripts[i].attributes; var scriptForReplace = document.createElement('script'); for (var j = 0; j < scriptAtts.length; j++){ var attVal = scriptAtts[j].value; if( attVal == '' ) attVal = true; scriptForReplace.setAttribute(scriptAtts[j].nodeName,attVal); } if( scripts[i].innerHTML != '' ){ scriptForReplace.innerHTML = scripts[i].innerHTML; } parentDiv.removeChild(scripts[i]); parentDiv.insertBefore(scriptForReplace, markerEl); parentDiv.removeChild( document.getElementById(markerElId) ); } })(window, document )