Merlin
Expert Member
Hi all,
I'm at the last error before my new 'site can get W3 XHTML 1.0 Strict validation.
My index page calls an include, part of which puts this into the head section:
----------------------------------------------------------------------------------------------------
echo <<<SCRIPT
<script type="text/javascript">
function decodeaddr(protectedaddr, domid, textafterhover){
var cleanAddr='';
for(i=0; i < cleanaddr.length+1; i+=2){
thisPiece=protectedaddr.substring(i,i+2);
cleanaddr=cleanaddr.concat(thisPiece.charAt(1), thisPiece.charAt(0));
}
if(textafterhover == 'decode'){
textafterhover = cleanaddr;
}
cleanaddr=textafterhover.link('mailto:'+cleanaddr);
document.getelementbyid(domid).innerhtml=cleanaddr;
}
</script>
SCRIPT;
----------------------------------------------------------------------------------------------------
It is failing on the Less Than sign here:
for(i=0; i < cleanaddr.length+1; i+=2){
I have tried changing it to a < and have also tried escaping it with a \ as recommended by the validator.
What else can I try please?
Thanks, Nic
I'm at the last error before my new 'site can get W3 XHTML 1.0 Strict validation.
My index page calls an include, part of which puts this into the head section:
----------------------------------------------------------------------------------------------------
echo <<<SCRIPT
<script type="text/javascript">
function decodeaddr(protectedaddr, domid, textafterhover){
var cleanAddr='';
for(i=0; i < cleanaddr.length+1; i+=2){
thisPiece=protectedaddr.substring(i,i+2);
cleanaddr=cleanaddr.concat(thisPiece.charAt(1), thisPiece.charAt(0));
}
if(textafterhover == 'decode'){
textafterhover = cleanaddr;
}
cleanaddr=textafterhover.link('mailto:'+cleanaddr);
document.getelementbyid(domid).innerhtml=cleanaddr;
}
</script>
SCRIPT;
----------------------------------------------------------------------------------------------------
It is failing on the Less Than sign here:
for(i=0; i < cleanaddr.length+1; i+=2){
I have tried changing it to a < and have also tried escaping it with a \ as recommended by the validator.
What else can I try please?
Thanks, Nic