In my previous post on this issue I've made a mistake – resulting code was in fact not valid XHTML Strict!

The problem is, there is no language property for <script> tag in (X)HTML Strict! In my example, it was used to detect the version of Javascript in visitor's browser, but this technique today is considered obsolete and useless (see Javascript – Object detection at quirksmode). If you still care, let me tell you there is no elegant way to find out what version of Javascript do you have. For example, The Ultimate JavaScript Client Sniffer is a script 8kb in size and, looking at its code, there is no way to cut it down to just several lines. BTW, author explicitly notes:

This document is obsolete and the information in it should not be relied upon. The practices described here are not recommended and this document is provided only for historical reference. Please see the web-developer documentation index page for more up-to-date documentation.

Anyway, this is just wrong. Either try object detection or, if you absolutely must use it with (X)HTML Strict, resort to server-side JS version detection.

And now here is valid XHTML code for my example:

          <!--Rating@Mail.ru COUNTER-->
<a href="http://top.mail.ru/jump?from=341994" id="m">
<script type="text/javascript">
d=document;a='';a+=';r='+escape(d.referrer)
js=10;a+=';j='+navigator.javaEnabled()
s=screen;a+=';s='+s.width+'*'+s.height
a+=';d='+(s.colorDepth?s.colorDepth:s.pixelDepth)
if (d.getElementById) {
var i=d.createElement("img");
i.src="http://top.list.ru/counter?id=341994;t=84;js="+Math.random()+js+a;
i.width=88;i.height=18;i.alt="Rating@Mail.ru";
d.getElementById("m").appendChild(i);
}</script>
<noscript><img src="http://top.list.ru/counter?js=na;id=341994;t=84" 
height="18" width="88" alt="Rating@Mail.ru" /></noscript></a>

        

Please note that above I'm explicitly setting js variable to 10 which essentially means Javascript v1.0. Perhaps it would be wiser to remove it altogether but here I'm leaving it for compatibility with original script. There is also some code (screen size detection, Java (not Javascript) support) which may not work with older browsers and even generate errors on client side – it could be safer to disable it for their sake.