Скрытие внешнего асинхронного тега Iframe Criteo, когда передача пуста
Надеюсь, кто-то может помочь нам. Нам нужно скрыть внешний iframe без обратной передачи, которую создает асинхронный тег Criteo (в результате чего появляется белое пустое пространство), когда баннер не загружен. Любая идея?
Это тег:
<div id="one" margin="0px">
<script>
var cto_zoneid_desktop = "xxxxxx";
var cto_zoneid_mobile = "xxxxxx";
var cto_lim_w = 700,cto_lim_h = 200,cto_zoneid_selected = cto_zoneid_desktop;
if( window.screen.width<window.cto_lim_w || window.screen.height<window.cto_lim_h){cto_zoneid_selected = cto_zoneid_mobile;}
var crt_curl = '#CLICK_URL_UNESC#';
(function(w,d,s,c,z,u){var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),l = '&loc=' + encodeURIComponent(w.location), r = d.referrer ? '&referer=' + encodeURIComponent(d.referrer) : '', g = u.substring(0,4) == 'http' ? '&ct0='+encodeURIComponent(u) : '', cb="&cb="+Math.floor(Math.random()*99999999999) ;j.async='true';j.src=(("https:"==location.protocol?"https:":"http:")+
'//cas.criteo.com/delivery/ajs.php?zoneid='+z+'&containerid='+c+g+l+r+cb).substring(0,2000);f.parentNode.insertBefore(j,f);
})(window,document,'script','one',cto_zoneid_selected,crt_curl);
</script>
</div>
1 ответ
Решение
Я нашел решение, чтобы скрыть iframe от Criteo в случае отсутствия баннера. Вставьте в пароль следующий код:
<script type="text/javascript">
window.frameElement.style.display = "none";
</script>
Оно работает. Надеюсь, это может кому-то помочь.