代码之家  ›  专栏  ›  技术社区  ›  Utku Dalmaz

jQuery.load()不会显示谷歌广告

  •  0
  • Utku Dalmaz  · 技术社区  · 15 年前

    我正在使用jQuery的 load 功能。

    但当我打开网页时,谷歌的广告并没有出现,即使它们出现了。

    我该怎么办?

    编辑:

    一些代码:

    函数加载php页面:

    function get_fb(g) {
    
    $("#hhs").load("hhs.php?rid="+g);
    
    }
    

    php包含google广告代码。。。

    1 回复  |  直到 15 年前
        1
  •  1
  •   ThiefMaster    15 年前

    广告通常通过脚本标签和 $(...).load() 删除任何脚本标记:

    // inject the contents of the document in, removing the scripts
    // to avoid any 'Permission Denied' errors in IE
    .append(res.responseText.replace(rscript, ""))
    

    rscript 是与脚本标记匹配的正则表达式: /<script(.|\s)*?\/script>/gi

    然而, AdSense for Ajax 可能是你需要的。

    推荐文章