XHTML Compliance

0 views
Skip to first unread message

Kerrick Bishto

unread,
Apr 27, 2008, 1:02:31 AM4/27/08
to AdSense API Forum
Does anyone know if Google served ads are output as valid xhtml. I
have xhtml compliant pages with google served ads and the W3C
validator is saying that the output is invalid xhtml. Does anyone know
what I can do?

daniel...@googlemail.com

unread,
Apr 28, 2008, 10:13:11 AM4/28/08
to AdSense API Forum
AdSense won't work with XHTML without a few hacks, because it uses
javascript Document.Write() which doesn't work with XHTML (because
that would allow new markup to be generated while it is still being
parsed), and even if it did, it would create an iframe element which
iteself is not valid for XHTML Strict.

Basically, what you have to do to work around this is move the adsense
code into a separate file and use an object tag with type text/html
e.g.
<object data="/adsense.php" type="text/html"></object>

On Apr 27, 8:02 am, Kerrick Bishto <christopher.rutherf...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages