PDA

View Full Version : Not XHTML valid


SubZane
03-12-2004, 10:32 AM
Hello,
I checked the box for generating XHTML code but it's not valid XHTML
here's the errors:


* Line 212, character 41:

... e="text/javascript" language="javascript">
^

Error: there is no attribute language for this element (in this HTML version)
* Line 218, character 161:

... ="http://www.statcounter.com"><img src="http://c1.statcounte ...
^

Error: element a not allowed here; possible cause is an inline element containing a block-level element
* Line 218, character 293:

... s software" /></a> </noscript>
^

Error: missing a required sub-element of noscript


My webpage is XHTML 1.1 and it won't validate with the counter script on it.
http://www.subzane.com (no counter until its xhtml 1.1 valid)

also your javascript file still generates old html 4 code instead of XHTML:


else if (window.sc_invisible) {
if(window.sc_invisible==1) {
sc_img = new Image();
sc_img.src = sc_tracking_url;
}
else {
document.writeln("<A HREF=\"http://www.StatCounter.com\" TARGET=\"_blank\"><IMG SRC=\""+sc_tracking_url+"\" ALT=\"StatCounter - Free Web Tracker and Counter\" BORDER=\"0\"><\/A>");
}
}
else {
document.writeln("<A HREF=\"http://www.StatCounter.com\" TARGET=\"_blank\"><IMG SRC=\""+sc_tracking_url+"\" ALT=\"StatCounter - Free Web Tracker and Counter\" BORDER=\"0\"><\/A>");
}

03-12-2004, 02:22 PM
Right. Well care to explain how we can make it xhtml valid?

SubZane
03-12-2004, 06:39 PM
of course! :)



<script type="text/javascript">
var sc_project=XXXXXX;
</script>

<script type="text/javascript" src="http://www.statcounter.com/counter/counter.js"></script><noscript><div class="statcounter">http://c1.statcounter.com/counter.php?sc_project=XXXXXX&amp;java=0 (http://www.statcounter.com)</div></noscript>



I added the class "statcounter" to every element just so that users may style them if they desire.

03-13-2004, 12:21 AM
OK thanks we changed it based on your recommendation. Let me know if it's ok now.

SubZane
03-13-2004, 07:35 AM
you need to remove the language="javascript" params as well, but that should be it!

SubZane
03-13-2004, 07:45 AM
also, for the javascript you need to change the document.write to

document.writeln('<div class="statcounter">'+sc_tracking_url+' (http://www.StatCounter.com)</div>');


and this as well


else if (window.sc_text) {
document.writeln('<scr' + 'ipt src="' + sc_tracking_url + '" type="text/javascript"></scr' + 'ipt>');
}

star
03-17-2004, 02:24 AM
The StatCounter code given for pasting into our html code is not valid XHTML, but from a message sent a few days ago that issue has been brought up. Since the terms and conditions are still in effect, i.e editing code given of which is not XHTML1.1 compliant, am I to assume the code can not (or should not) be used since changes brought up to this code have not yet taken effect and given to users.

Thanks, S.

SubZane
03-17-2004, 08:48 AM
quite right