You are here: W3C html validator flags error in javascript « HTML « IT news, forums, messages
W3C html validator flags error in javascript

Posted by xyZed on 03/25/06 15:24

Although related to false javascript errors during validation checks,
this is a question about html validation.

I have several affiliate links stopping my pages validating. They use
javascript which I don't understand. Apparently it's a known issue
that html validators can erroneously flag javascript errors.

I have read the information on this page

http://www.htmlhelp.com/tools/validator/problems.html#script

which offers a solution. But I do not want to accidently disable the
javascript functions of my affiliate links by adding stuff I don't
understand.

The W3C (and dreamweaver's) validators flag the following error -

< found between tags. Consider using the equivalent entity (&amp =
'&', &lt = '<', &gt = '>', &quot = quotation mark). [HTML 4.0]

And this is the script it flags up -

<script type="text/javascript">
var uri = 'http://impgb.tradedoubler.com/imp/js/16125532/1079419?' +
new String (Math.random()).substring (2, 11);
document.write('<sc'+'ript language="javaScript" src="'+uri+'"
charset="ISO-8859-1"></sc'+'ript>');
</script>


I can fix this by adding a back slash here <\/sc'+'ript>' as mentioned
on
http://www.htmlhelp.com/tools/validator/problems.html#script

<quoting relevant passage>

"A common error (and the most common source of erroneous bug reports
for the WDG HTML Validator) occurs when writing HTML tags within a
SCRIPT element:

<script type="text/javascript">
<!--
// This is an error!
document.write("</P>");
// -->
</script>

(The fix is to add a backslash -)

<script type="text/javascript">
<!--
document.write("<\/P>");
// -->
</script>
</quote>


I'm hoping someone can tell me if this is a legitimate fix and that it
won't interfere with the javascript functions please












--

Free washing machine help and advice.

www.washerhelp.co.uk

www.xyzed.co.uk/newsgroups/top-posting.html

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация