Hi, I have this problem I need to use this javascript code to store statistic information about my web site:
<script type=”text/javascript” language=”JavaScript”>
// Define the location of count.asp
// Using a path, you may use this code in any subfolder
var file=’stats/count.asp’;
var d=new Date();
var s=d.getSeconds();
var m=d.getMinutes();
var x=s*m;
var h=new String;
var c=new String;
var r=new String;
var f=new String;
var u=new String;
var fs=new String;
var b=new String;
f=” + escape(document.referrer);
if (navigator.appName==’Netscape’){b=’NS’;}
if (navigator.appName==’Microsoft Internet Explorer’){b=’MSIE’;}
if (navigator.appVersion.indexOf(‘MSIE 3′)>0) {b=’MSIE’;}
u=” + escape(document.URL); w=screen.width; h=screen.height;
v=navigator.appName;
fs = window.screen.fontSmoothingEnabled;
if (v!= ‘Netscape’) {c=screen.colorDepth;}
else {c=screen.pixelDepth;}
j=navigator.javaEnabled();
info=’w=’ + w + ‘&h=’ + h + ‘&c=’ + c + ‘&r=’ + f + ‘&u=’+ u + ‘&fs=’ + fs + ‘&b=’ + b + ‘&x=’ + x;
document.write(‘<img src=”‘ + file + ‘?’+info+ ‘” width=0 height=0 border=0 />’);
</script>
When I try to validate Xhtml 1.0 Transitional the code, the validator send this error:
Line 189, column 18: cannot generate system identifier for general entity “h”
info=’w=’ + w + ‘&h=’ + h + ‘&c=’ + c + ‘&r=’ + f + ‘&u=’+ u + ‘&fs=’ + fs + ‘&b
An entity reference was found in the document, but there is no reference by that name defined. Often this is caused by misspelling the reference name, unencoded ampersands, or by leaving off the trailing semicolon (?. The most common cause of this error is unencoded ampersands in URLs as described by the WDG in “Ampersands in URLs”.
Entity references start with an ampersand (&) and end with a semicolon (?. If you want to use a literal ampersand in your document you must encode it as “&” (even inside URLs!). Be careful to end entity references with a semicolon or your entity reference may get interpreted in connection with the following text. Also keep in mind that named entity references are case-sensitive; &Aelig; and æ are different characters.
Note that in most documents, errors related to entity references will trigger up to 5 separate messages from the Validator. Usually these will all disappear when the original problem is fixed.
✉
Line 189, column 18: general entity “h” not defined and no default entity
info=’w=’ + w + ‘&h=’ + h + ‘&c=’ + c + ‘&r=’ + f + ‘&u=’+ u + ‘&fs=’ + fs + ‘&b
This is usually a cascading error caused by a an undefined entity reference or use of an unencoded ampersand (&) in an URL or body text. See the previous message for further details.
✉
Line 189, column 19: reference not terminated by REFC delimiter
info=’w=’ + w + ‘&h=’ + h + ‘&c=’ + c + ‘&r=’ + f + ‘&u=’+ u + ‘&fs=’ + fs + ‘&b
If you meant to include an entity that starts with “&”, then you should terminate it with “;”. Another reason for this error message is that you inadvertently created an entity by failing to escape an “&” character just before this text.
✉
Line 189, column 19: reference to entity “h” for which no system identifier could be generated
info=’w=’ + w + ‘&h=’ + h + ‘&c=’ + c + ‘&r=’ + f + ‘&u=’+ u + ‘&fs=’ + fs + ‘&b
This is usually a cascading error caused by a an undefined entity reference or use of an unencoded ampersand (&) in an URL or body text. See the previous message for further details.
✉
Line 189, column 17: entity was defined here
info=’w=’ + w + ‘&h=’ + h + ‘&c=’ + c + ‘&r=’ + f + ‘&u=’+ u + ‘&fs=’ + fs + ‘&b
Line 189, column 30: cannot generate system identifier for general entity “c”
info=’w=’ + w + ‘&h=’ + h + ‘&c=’ + c + ‘&r=’ + f + ‘&u=’+ u + ‘&fs=’ + fs + ‘&b
✉
Line 189, column 30: general entity “c” not defined and no default entity
info=’w=’ + w + ‘&h=’ + h + ‘&c=’ + c + ‘&r=’ + f + ‘&u=’+ u + ‘&fs=’ + fs + ‘&b
✉
Line 189, column 31: reference not terminated by REFC delimiter
info=’w=’ + w + ‘&h=’ + h + ‘&c=’ + c + ‘&r=’ + f + ‘&u=’+ u + ‘&fs=’ + fs + ‘&b
✉
Line 189, column 31: reference to entity “c” for which no system identifier could be generated
info=’w=’ + w + ‘&h=’ + h + ‘&c=’ + c + ‘&r=’ + f + ‘&u=’+ u + ‘&fs=’ + fs + ‘&b
✉
Line 189, column 29: entity was defined here
info=’w=’ + w + ‘&h=’ + h + ‘&c=’ + c + ‘&r=’ + f + ‘&u=’+ u + ‘&fs=’ + fs + ‘&b
Line 189, column 42: cannot generate system identifier for general entity “r”
…’w=’ + w + ‘&h=’ + h + ‘&c=’ + c + ‘&r=’ + f + ‘&u=’+ u + ‘&fs=’ + fs + ‘&b=’
How can I write variables correct with valid Xhtml? Some ideas Cetalfio