javascript - 接入GoogleAdsense代码报错?
ringa_lee
ringa_lee 2017-04-10 17:16:29
[JavaScript讨论组]

获取到Google代码:


    
    
    
    

加入到网页p中。会操错如下:

Uncaught SecurityError: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin "http://www.jeffjade.com" from accessing a frame with origin "http://googleads.g.doubleclick.net". Protocols, domains, and ports must match.

目测看着像是跨域了,搜索网上方法,采用

等等一系列尝试,还是会有各种问题,比如

Uncaught SecurityError: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin "http://www.jeffjade.com" from accessing a frame with origin "https://googleads.g.doubleclick.net". The frame requesting access has a protocol of "http", the frame being accessed has a protocol of "https". Protocols must match.

所以在这里请教下,这问题该如何解决呢?感谢。

ringa_lee
ringa_lee

ringa_lee

全部回复(2)
巴扎黑

喔,接入googleAdsense本身没有问题,是自己的 Chrome安装了一个 markdown-here插件 所引发的问题。禁掉该插件就好了。

迷茫

我放进去没有报错,但是广告位有高度,是一片空白。ins里面嵌入iframe,里面的head,和body都是空的。怎么回事?

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号