【发布时间】:2023-04-08 12:56:02
【问题描述】:
我试图在从 Firebase 加载内容后加载 AdSense 响应式广告,但是没有广告显示,只是空白。将代码放到网上后出现错误:
availableWidth=0 没有插槽大小
我在谷歌浏览了大约 4 个页面来寻找解决方案,但找不到一个,所以我想你可以帮助我。
我正在应用 AdSense 代码,如下所示:
<head>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
</head>
<body>
<div id="demo" style="display: none;">
<!-- SnusPedia automatic size add -->
<style>
.example_responsive_1 { width: 320px; height: 100px; }
@media(min-width: 500px) { .example_responsive_1 { width: 468px; height: 60px; } }
@media(min-width: 800px) { .example_responsive_1 { width: 728px; height: 90px; } }
</style>
<ins class="adsbygoogle example_responsive_1"
style="display:block"
data-ad-client="ca-pub-8297030761327810"
data-ad-slot="9809929086"
data-ad-format="auto"></ins>
<script>
window.onload = function(){
(adsbygoogle = window.adsbygoogle || []).push({});
}
</script>
</div>
</body>
什么可能导致问题?
【问题讨论】:
-
所有内容都包含在
<div id="demo" style="display: none;">中吗?我没有看到关闭</div>标签 -
是的,所有内容都包含在
<div id="demo" style="display: none;">中,实际上我也有结束标签,也只是输入问题。 -
那么你什么时候删除
display: none? -
Firebase 查询完成后的@Morpheus。
标签: jquery html css twitter-bootstrap adsense