I am trying to display google ads on xhtml file, but chorme browser down’t show them up. The ads show on all other browsers I tried (Ie,firefox,opera) but chrome. Has anyone encountered this before?
Small sample code:
<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>
Thanks
Smitha
The problem is google js file uses document.write, which is not allowed in a application/xhtml+xml page
I guess this will solve your problem
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