Last active
August 29, 2015 14:27
-
-
Save werty1st/5356825fd327e52f76ca to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function insertScript(url) { | |
scriptEl = document.createElement('script'); | |
scriptEl.type = 'text/javascript'; | |
scriptEl.async = true; | |
scriptEl.src = url; | |
document.getElementsByTagName('head')[0].appendChild(scriptEl); | |
} | |
function appendHtml(el, str) { | |
var div = document.createElement('div'); | |
div.innerHTML = str; | |
while (div.children.length > 0) { | |
el.appendChild(div.children[0]); | |
} | |
} | |
var html = '<div class="zdfembed" id="_123949b2e53f3580ee38fc0de144b68eb1c9ac3a" ><div class="socialbox" ><picture> <source srcset="http://sofa01.zdf.de/c/twr/123949b2e53f3580ee38fc0de144b68eb1c9ac3a/768px" media="(min-width: 320px)"><source srcset="http://sofa01.zdf.de/c/twr/123949b2e53f3580ee38fc0de144b68eb1c9ac3a/320px" media="(max-width: 320px)"><img style="widthx: 100%;" srcset="http://sofa01.zdf.de/c/twr/123949b2e53f3580ee38fc0de144b68eb1c9ac3a/320px" alt="Vorschaubild Social Media"></picture><span class="caption fade-caption"><div class="relative_wrapper_social"> <h3>Ihr Klick für den Datenschutz</h3> <p>Erst wenn Sie hier klicken, werden Bilder und andere Daten von Drittanbietern nachgeladen. Ihre IP-Adresse wird dabei an externe Server (Facebook, Google, Twitter etc.) übertragen. Über den Datenschutz dieser Anbieter können Sie sich auf den jeweiligen Seiten informieren. </p><button class="button" onclick="activateSocial()">Einverstanden</button><a class="settingsbutton" href="http://www.zdf.de/social-media-optin-37013018.html"><button class="socialbottom button" >Datenschutz Einstellung</button></a></div></span> </div></div>'; | |
var target = document.getElementById('content_d73ab14336b9674277f399d838d4d70e') | |
target.removeChild(target.childNodes[0]) | |
insertScript('https://cdnjs.cloudflare.com/ajax/libs/picturefill/2.3.0/picturefill.min.js'); | |
appendHtml(target, html); | |
insertScript('http://sofa01.zdf.de/c/twr/123949b2e53f3580ee38fc0de144b68eb1c9ac3a/script.js'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment