0

我正在使用 jQuery 的加载功能将包含 Google 广告的页面加载到另一个页面中。

但是,即使当我打开页面本身时,Google 广告也不会出现。

我该怎么办?

编辑:

一些代码:

函数加载php页面:

function get_fb(g) {

$("#hhs").load("hhs.php?rid="+g);

}

并且 hhs.php 包含谷歌广告代码......

4

1 回答 1

1

广告通常通过脚本标签嵌入并$(...).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 。

于 2010-11-11T22:02:18.703 回答