html validation of external counter

liunx

Guest
looking around for counters/free stats and at the same time trying to validate my page as 'html 4 transitional' is giving me some trouble..., i found a host that provides a following code:<br />
<script language="javascript" TYPE="text/javascript"><br />
var data, p;<br />
var agt=navigator.userAgent.toLowerCase();<br />
p='http';<br />
if((location.href.substr(0,6)=='https:')||(location.href.substr(0,6)=='HTTPS:')) {p='https';} data = '&r=' + escape(document.referrer) + '&n=' + escape(navigator.userAgent) + '&p=' + escape(navigator.userAgent)<br />
if(navigator.userAgent.substring(0,1)>'3') {data = data + '&sd=' + screen.colorDepth + '&sw=' + escape(screen.width+ 'x'+screen.height)};<br />
document.write('<a href=http://www.htmlforums.com/archive/index.php/"http://www.terrafirmahosting.com/counter" target="_blank" >');<br />
document.write('<img border=0 hspace=0 '+'vspace=0 src=http://www.htmlforums.com/archive/index.php/"http://www.terrafirmahosting.com/counter/counter.php?i=xx' + data + '"> </a>');<br />
</script> which wont validate..., anyway to fix that? or alternatively some1 knows the host that provides a clean code? (hiden counter, simple stats - free/no adds - will do just fine)<br />
<br />
tia :D<!--content-->i use sitemeter.com for mine. not sure how well they validate. i always ignore that stuff, particularly code provided by 3rd-parties.<!--content-->host your own, have a look through hotscripts (<!-- m --><a class="postlink" href="http://www.hotscripts.com">http://www.hotscripts.com</a><!-- m -->) if you find one that you like wich isn't invisible, just put it in a div an set layer visibility to hidden :)<!--content-->tnx for replys, i manage to fix it without breaking the counter:<br />
last 2 lines:<br />
document.write('<img border=0 hspace=0 '+'vspace=0 src=http://www.htmlforums.com/archive/index.php/"http://www.terrafirmahosting.com/counter/counter.php?i=xx' + data + '">');<br />
document.write('<' + '/' + 'a' + '>');<!--content-->When counter code breaks my usual comment is:<br />
<br />
<br />
Hide any closing tags like '</td>' that are within document.write statements by either breaking them open '</' + 'td>' or by escaping them <\/td> and the validator will no longer complain about these closing tags.<br />
<br />
<br />
Is there anything else in that code that is being flagged as an error?<br />
<br />
<br />
<edit>You got there before I posted</edit><!--content-->
 
Back
Top