javascript - inmobi javascript 返回空横幅

标签 javascript inmobi

我想从 inmobi 获得测试广告横幅。根据 inmobi Developer Wiki

http://developer.inmobi.com/wiki/index.php?title=JavaScript

这个脚本

    <script type="text/javascript">
        var inmobi_conf = {
        siteid : "4028cba631d63df10131e1d3191d00cb",
        slot : "15",
        test: "true"
    };
    </script><script type="text/javascript" src="http://cf.cdn.inmobi.com/ad/inmobi.js"></script>

必须返回 320x50 的测试横幅,但它总是返回空横幅。 请帮忙。我究竟做错了什么?

最佳答案

您收到“无填充响应”。从您提供的链接:

For example, if a publisher faces an NFR (No-Fill Response) scenario, a callback is sent notifying that there is an NFR. The publisher can now take steps to address and blank real estate issue that was caused by non-availability of ads.

<div id="my-ad-slot">
<script type="text/javascript">
  var inmobi_conf = {
    siteid : "your site id",
    slot : "slot number",
    test: true,
    onError : function(code) {
        if(code == "nfr") {
            document.getElementById("my-ad-slot").style.display = "none";
            // do something else. call to other ad network or logic to display in-house ads, etc. 
        }
    }
  };
</script>
<script type="text/javascript" src="http://cf.cdn.inmobi.com/ad/inmobi.js"></script>
</div>

上述代码示例中,参数code在没有返回广告时会给出nfr。

关于javascript - inmobi javascript 返回空横幅,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19126212/

相关文章:

javascript - AngularJS - ngrepeat 错误中的重复键

javascript - 拆分 JavaScript 字符串中的最后一个单词值

Javascript 不断累加总和

android - Inmobi android 集成错误

JavaScript -- 切片时间字符串返回 HH :MM

javascript - 将时间戳转换为日期会在结果中给出不同的时区吗?

android - D/InMobi 横幅 : Ad request successful but no ad served

android - 如何将插屏广告带到最前面?

mopub - 如何使用MoPub初始化InMobi? #withAdditionalNetwork