w3c XHTML validation error for statcounter code ?
StatCounter.com is one of the best free hit counter providers for webmasters. When it comes to web analytics, their free web counters is one among the most widely used one.
I use Stat Counter on my sites including this blog, but what I noticed is that their code is not compliant to the XHTML markup validation provided by W3C even if you create a code selecting the XHTML option while creating the code.
I had validation problem using statcounter on this blog, which I could fix. I would like to share the same with others.
When you create statcounter code for XHTML pages, following is what you get as part of the code.
src="http://c22.statcounter.com/counter.php?
sc_project=xxxxxxx
&java=0&security=xxxxxxx&invisible=1" alt="free webpage hit counter"
The ambersand ‘&’ coming in the code is what creates the validation error.
Check
src="http://c22.statcounter.com/counter.php?
sc_project=xxxxxxx
&java=0&security=xxxxxxx&invisible=1
It has ambersands in the URL.
Just replace all the ambersands ‘&’ with ‘& amb ;’ (No spaces in between & amb and ; ) . Thats it..
Once you do this change, validate your page for W3C compliance, if there are no other errors in the page, you are through !!