{"id":10813,"date":"2018-11-28T08:14:09","date_gmt":"2018-11-28T07:14:09","guid":{"rendered":"http:\/\/www.wjst.de\/blog\/?p=10813"},"modified":"2018-11-28T10:15:19","modified_gmt":"2018-11-28T09:15:19","slug":"embed-youtube-videos-without-pre-loading-any-data","status":"publish","type":"post","link":"https:\/\/www.wjst.de\/blog\/sciencesurf\/2018\/11\/embed-youtube-videos-without-pre-loading-any-data\/","title":{"rendered":"Embed youtube videos without pre-loading any data"},"content":{"rendered":"<p>This short script is quite useful for DSGVO complaint, aeh compliant websites. Just put a grey picture in <em>\/images\/externalcontent.png<\/em> or wherever you want<\/p>\n<figure style=\"width: 560px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" src=\"\/images\/img\/externalcontent.png\" alt=\"\" width=\"560\" height=\"315\" \/><figcaption class=\"wp-caption-text\">\/images\/externalcontent.png<\/figcaption><\/figure>\n<p>and insert a short script in the wordpress header.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\nfunction showyou() {\r\n  $('iframe&#x5B;name*=&quot;.com&quot;]').each(function(e) {\r\n    var src=$(this).attr('name');\r\n    $(this).attr('src',src);\r\n    $(this).show();\r\n  });\r\n}\r\n$(document).ready(function(){\r\n  $('iframe&#x5B;src*=&quot;.com&quot;]').each(function(e) {\r\n    var src=$(this).attr('src');\r\n    $(this).attr('name',src );\r\n    $(this).attr('src','');\r\n    $(this).after('&lt;img class=&quot;me&quot; src=&quot;\/images\/externalcontent.png&quot; onclick=&quot;$(\\'.me\\').hide();showyou();&quot;\/&gt;\r\n');\r\n    $(this).hide();\r\n  });\r\n});\r\n<\/pre>\n\n<p>&nbsp;<\/p>\n<div class=\"bottom-note\">\n  <span class=\"mod1\">CC-BY-NC Science Surf , accessed 03.04.2026<\/span>\n <\/div>","protected":false},"excerpt":{"rendered":"<p>This short script is quite useful for DSGVO complaint, aeh compliant websites. Just put a grey picture in \/images\/externalcontent.png or wherever you want and insert a short script in the wordpress header. function showyou() { $(&#8216;iframe&#x5B;name*=&quot;.com&quot;]&#8217;).each(function(e) { var src=$(this).attr(&#8216;name&#8217;); $(this).attr(&#8216;src&#8217;,src); $(this).show(); }); } $(document).ready(function(){ $(&#8216;iframe&#x5B;src*=&quot;.com&quot;]&#8217;).each(function(e) { var src=$(this).attr(&#8216;src&#8217;); $(this).attr(&#8216;name&#8217;,src ); $(this).attr(&#8216;src&#8217;,&#8221;); $(this).after(&#8216;&lt;img class=&quot;me&quot; src=&quot;\/images\/externalcontent.png&quot; onclick=&quot;$(\\&#8217;.me\\&#8217;).hide();showyou();&quot;\/&gt; &hellip; <a href=\"https:\/\/www.wjst.de\/blog\/sciencesurf\/2018\/11\/embed-youtube-videos-without-pre-loading-any-data\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Embed youtube videos without pre-loading any data<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[3078,809],"class_list":["post-10813","post","type-post","status-publish","format-standard","hentry","category-computer-software","tag-dsgvo","tag-youtube"],"_links":{"self":[{"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/posts\/10813","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/comments?post=10813"}],"version-history":[{"count":4,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/posts\/10813\/revisions"}],"predecessor-version":[{"id":10828,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/posts\/10813\/revisions\/10828"}],"wp:attachment":[{"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/media?parent=10813"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/categories?post=10813"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/tags?post=10813"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}