<!DOCTYPE html>
<html>
<head>
This is the head of your page.
<title>Example HTML page</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>
<body>
This is the body of your page.
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- horizontal ad -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1677523677681098"
data-ad-slot="1902657162"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
This is the body of your page.
</body>
</html>[enter image description here][1]
它显示ERR:FILE NOT FOUND。 我使用过本地adsgoogle.js,但它没有用。 我已经在下面附上了控制台的截图。
答案 0 :(得分:1)
您看到这一点的原因是因为行//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js
。这是与协议相关的。
在屏幕截图中,您是从file:///
加载的 - 您的计算机上不存在http
或https
协议所在的路径。
要解决此问题,请考虑将src
更改为https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js
或将其指向相对路径(如果您希望加载本地adsbygoogle.js
文件。
如果您在本地安装了Python,另一个解决方案是运行本地网络服务器,并通过http
而不是file
协议查看您的网站。这可以通过打开终端cd
到您的桌面,然后运行python -m SimpleHTTPServer
,然后在浏览器中访问http://localhost:8000来完成。
答案 1 :(得分:0)
您在Chrome中使用ABP - Adb-blocker extension
。这就是阻止广告显示。尝试禁用ABP Extension
并刷新(Ctrl + F5)