2010-08-19 83 views
0

我想在xhtml文件上显示谷歌广告,但chorme浏览器down't显示出来。这些广告在我尝试过的所有其他浏览器上显示(即,Firefox,Opera)但Chrome浏览器。有没有人遇到过这个? 小样本代码:铬浏览器不显示xhtml文件的谷歌广告

<html xmlns="http://www.w3.org/1999/xhtml"> 
    <body> 
<script language="javascript"> 

google_ad_client = "pub-4942221729702985"; 
google_ad_slot = "0095628928"; 
google_ad_width = 728; 
google_ad_height = 90; 
</script> 
<script language="javascript" 
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> 
</script> 
</body> 
    </html> 

感谢 Smitha

回答

1

的问题是谷歌js文件使用文件撰写,这是不是在支持application/xhtml + XML页面

我想这将允许解决你的问题

http://www.cromwell-intl.com/technical/google-adsense-and-xhtml.html

http://ejohn.org/blog/xhtml-documentwrite-and-adsense/

http://randsco.com/index.php/2005/11/10/serving_xhtml_with_the_right_mime_type

的W3C建议所有XHTML 文件中担任 的 “application/xhtml + xml”。这是因为 XHTML要求更加严格 验证和代码不 含有不同标签的无数 (又名“标签汤”)需要被 支持“text/html的”(一个好处 是XHTML呈现更快)。

+0

非常感谢您的回复。它适用于我的链接:http://www.cromwell-intl.com/technical/google-adsense-and-xhtml.html。 再次感谢! Smitha – Smitha 2010-08-20 21:11:51