【发布时间】:2012-03-17 16:42:45
【问题描述】:
我在我的网站中使用谷歌广告,如下所示。
<script type="text/javascript"><!--
google_ad_client = "pub-";
/*Top 468x15 */
google_ad_slot = "";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
此代码来自管理端,无法更改(网站架构就是这样),如果有 html 注释,则广告不会显示,但是当我在显示之前将 js 中的 html 注释替换为 null 时,它会显示它。现在的问题是,如果页面中有任何其他 html 注释,我的 str_replace 代码也会替换它。原始 html 注释显示为纯文本。有什么解决办法吗?请帮忙。谢谢
【问题讨论】:
-
只要放下 cmets;这些天不需要它们。 stackoverflow.com/questions/4421599/…
-
我知道,但我不能这样做,因为它是从管理员端添加的内容。还有其他选项可以仅删除脚本中的评论标签吗?
标签: php javascript