- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在我的 angularjs 应用程序中使用了 adsesne 代码。在第一次加载应用程序时,当我动态切换内容时,广告工作正常,出现此错误。Exception in queued GPT command TypeError: Cannot read property 'addService' of null site:stackoverflow.com
.
这是我在 div 中加载的脚本。
<script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script>
<script>
window.googletag = window.googletag || {cmd: []};
googletag.cmd.push(function() {
googletag.defineSlot('/28379801/MWBanner320x50', [320, 50], 'div-adlocation').addService(googletag.pubads());
googletag.enableServices();
});
</script>
<!-- /28379801/MWBanner320x50 -->
<div id='div-adlocation' style='width: 320px; height: 50px; margin:auto'>
<script>
googletag.cmd.push(function() { googletag.display('div-adlocation'); });
</script>
</div>
最佳答案
我有同样的问题,看到你的帖子。仅在两周后,我才偶然发现,如果您使用相同的 adUnitPath
两次定义插槽,您会得到相同的错误。 .也许你有同样的问题。
解决方案
确保 adUnitPath
只定义一次。为我检查这个最简单的方法是 console.log(<the adUnitPath>)
每 googletag.defineSlot(...)
称呼。在屏幕截图中,您可以看到两次尝试定义同一个插槽。但是,这是不可能的,因为 adUnitPath 必须是唯一的。
Example of the error and the double define action
关于angularjs - 排队 GPT 命令中的异常类型错误 : Cannot read property 'addService' of null,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62347160/
来自 MSDN 的关于制作自定义配置部分的示例应该如下所示, class RemoteServiceSection : ConfigurationSection { [Configuratio
我在 iOS CoreBluetooth 上遇到崩溃问题 [CBPeripheralManager 添加服务:]。 似乎是由于 addService 方法中的断言失败而发生的。试了很多方法,还是解决不
我已经创建了系统应用程序。它有一个 aidl 文件和服务。我已经在服务方法 onStartCommand() 中实现了 aidl 接口(interface)和 addService。 mBinder
是否可以使用 C++ Binder API 在两个非特权进程之间进行通信? 我找到的所有示例(例如 https://github.com/mcr/Android-HelloWorldService)都
我创建了一个蓝牙外设管理器。我正在使用 [self.peripheralManager addService:myService] 向这个外设管理器添加一些服务。 对于 iOS7.0,我收到了此方法的
我在我的 angularjs 应用程序中使用了 adsesne 代码。在第一次加载应用程序时,当我动态切换内容时,广告工作正常,出现此错误。 Exception in queued GPT comma
我有以下 WebJob 功能... public class Functions { [NoAutomaticTrigger] public static void Emailer(I
我正在尝试向服务器发送一个 http 帖子,但我从我的 Controller 收到一个格式错误的 url 异常 Controller 代码 public static final String RES
我是一名优秀的程序员,十分优秀!