Forum Moderators: martinibuster

Message Too Old, No Replies

Illegal XML characters In AdSense

HTML Tidy Changes AdSense Code

         

jdhuk

7:04 am on Jul 2, 2005 (gmt 0)

10+ Year Member



After using HTML tidy to clean my messy pages I noticed that the Adsense code has slightly changed.

My question is do I now manually go over my pages and remove these characters //<![CDATA[ and //]]> or leave them?

Thanks

Rodney

8:03 am on Jul 2, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm pretty sure that modifying the adsense code would be violating the terms of service, if I understand what you're asking.

I's say don't sweat the small stuff :)

dmorison

8:31 am on Jul 2, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you put the CDATA qualifiers in yourself before using HTML Tidy it should leave the AdSense code untouched, eg.

<span><![CDATA[

<!-- AdSense Code Here -->

]]></span>

MichaelCrawford

1:26 pm on Jul 2, 2005 (gmt 0)



You don't want the adsense code in a CDATA section. What that means is that the contents of it are not taken as markup, but as literal text. If a browser interpreted that according to the SGML standards, it would cause the adsense code to show up literally in the page instead of the ad.

You probably should remove your adsense code before running tidy, then add it back in afterwards.

Also, after you run tidy, check your markup with the W3C validation service at [validator.w3.org...] If you don't have too many errors in your markup, you're probably better off using the validator and correcting your markup by hand.

jdhuk

8:10 pm on Jul 2, 2005 (gmt 0)

10+ Year Member



Thanks for the help.