lrony* 2016-12-11 11:00 采纳率: 0%
浏览 83

在Ajax页面上显示广告

I have ajax build website where all the pages are generated inside the main page(s). I was trying to put some ads (not adsense ) For example amazon native , media net or adcash. When I place the code ad does not show on the pages, even after page/site refresh. I can see in the source code, the script is there. Maybe javascript on ajax is the problem... idk... Any solutions?

  • 写回答

1条回答 默认 最新

  • weixin_33681778 2016-12-11 14:52
    关注

    What I normally do is place the ads code in a separate html file and load it externally.

    For instance. create and name a div and load it as such with jquery or javascript

    HTML

    <div id="thediv"></div>
    

    Jquery

    $('#thediv').load("url/ads.html")
    

    Javascript

    function load_ads() {
     document.getElementById("#thediv").innerHTML='<object type="text/html" data="url/ads.html" ></object>';
    }
    
    评论

报告相同问题?

悬赏问题

  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题