Javascript errors from Google Adsense

后端 未结 9 2178
无人共我
无人共我 2020-11-30 22:44

On several of my adsense running sites, I have been getting the following errors:

Unable to post message to [http://]googleads.g.doubleclick.n

相关标签:
9条回答
  • 2020-11-30 23:29

    A crossdomain.xml file in the site root allowing access to googleads.g.doubleclick.net should fix it.

    See this page, http://www.warriorforum.com/adsense-ppc-seo-discussion-forum/458906-adsense-blank-space-problem.html

    0 讨论(0)
  • 2020-11-30 23:32

    It's normal because your browser prevents CSRF attacks from other websites.

    To allow googleads... to access your website and solve this problem, create a file named crossdomain.xml in your webroot and fill it with the following content:

    <?xml version="1.0"?>
    <!DOCTYPE cross-domain-policy 
      SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
    <cross-domain-policy>
      <allow-access-from domain="googleads.g.doubleclick.net" />
    </cross-domain-policy>
    

    To test it, go to your domain http://your-domain.com/crossdomain.xml and make sure there are no errors for that page. You also allowed to use wildcards, etc (look at reference). When you're done, refresh your page. Hope that helps.

    Live example: http://www.blanjamudah.com/crossdomain.xml

    Reference: http://en.wikipedia.org/wiki/Cross-site_request_forgery http://curtismorley.com/2007/09/01/flash-flex-tutorial-how-to-create-a-crossdomainxml-file/

    0 讨论(0)
  • 2020-11-30 23:33

    Simply moving <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> to the top of the page above the ads, instead of below, fixed this for me

    0 讨论(0)
提交回复
热议问题