首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >空回时隐藏外部Iframe Criteo异步标记

空回时隐藏外部Iframe Criteo异步标记
EN

Stack Overflow用户
提问于 2016-01-13 15:12:01
回答 1查看 633关注 0票数 0

希望有人能帮我们。当未加载横幅时,我们需要隐藏异步Criteo标记创建的不带回传的外部iframe (导致空白)。有什么想法吗?

这是标签:

代码语言:javascript
复制
    <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>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-01-14 14:33:09

我找到了一个解决方案,在没有横幅的情况下,将iframe隐藏在Criteo面前。将下面的代码放入回传:

代码语言:javascript
复制
    <script type="text/javascript">
    window.frameElement.style.display = "none";
    </script>

它起作用了。希望能帮上忙。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34770195

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档