Schlagwort-Archive: DSGVO

Embed youtube videos without pre-loading any data

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

/images/externalcontent.png

and insert a short script in the wordpress header.

function showyou() {
  $('iframe[name*=".com"]').each(function(e) {
    var src=$(this).attr('name');
    $(this).attr('src',src);
    $(this).show();
  });
}
$(document).ready(function(){
  $('iframe[src*=".com"]').each(function(e) {
    var src=$(this).attr('src');
    $(this).attr('name',src );
    $(this).attr('src','');
    $(this).after('<img class="me" src="/images/externalcontent.png" onclick="$(\'.me\').hide();showyou();"/>
');
    $(this).hide();
  });
});