【问题标题】:OpenX Google Ads causing javascript errors in ChromeOpenX Google Ads 在 Chrome 中导致 javascript 错误
【发布时间】:2013-10-10 08:03:07
【问题描述】:

在我们的网站上,我们在某些页面上通过 OpenX 投放了 Google Ads。在这些页面中,此错误出现在 Google Chrome 浏览器控制台中。页面加载时出现很多次。

错误的形式是

Blocked a frame with origin "http://ox-d.<openxdomain>.com" from accessing a frame with origin "http://real website domain". Protocols, domains, and ports must match. 

此错误不会出现在没有 GoogleAds 的任何页面中。 (其他页面有不提供谷歌广告的 OpenX 横幅。这些不会导致此问题。)所有 OpenX 横幅都是 iframe。

这是因为我们的网站出现问题吗?还是这是 OpenX/GoogleAds/Google Chrome 的问题?

谢谢

【问题讨论】:

    标签: javascript google-chrome iframe adsense openx


    【解决方案1】:

    这是因为谷歌浏览器比其他浏览器具有更强的安全跨域策略。

    首先,检查iframe 标签。它应该以&lt;/iframe&gt; 结尾,而不仅仅是/&gt; 然后,您应该尝试从 iframe src 属性中删除协议方案 (http[s]:)。

    例如:

    最后,您应该“授予访问权限”您的

    http://real website domain

    在你的openx服务器上通过设置

    Access-Control-Allow-Origin: real.website.domain
    Access-Control-Allow-Headers: X-Requested-With, Content-Type
    

    【讨论】:

      【解决方案2】:

      如果您的 OpenX 安装在其他域中,那么有时 google 不允许将其广告代码放置在 iframe 中。

      请尝试 GoogleAds 的 javascript 调用代码类型,这应该可以正常工作。检查并将您的评论放在这里。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-06-16
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多