Forum Moderators: open
end tag for element "STRONG" which is not open
test='<strong>text</strong>';
It seems really strange to me as I wouldn't have expected the javascript to be validated for closing html tags anyway. I know I can tweak this so the validator misses it, but for instance . . .
test='<strong>text</'+'strong>';
. . . but was wondering if anyone knew WHY it was happening. Thanks in advance for any suggestions. I'll post the snippet of code below . . .
Vince
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Title</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
</head>
<body>
<script language="javascript" type="text/javascript">
test='<strong>text</strong>';
</script>
</body></html>
Sometimes the validator gets it wrong! Some of us have a hard time accepting that, but it's the harsh reality! ;)
What I find interesting is that the validator didn't complain about your DTD or the deprecated language attribute on:
<script language="javascript" type="text/javascript">
I wonder if this may be throwing it slightly...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Title</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
</head>
<body>
<script language="javascript" type="text/javascript">
test='<strong>text<\/strong>';
</script>
</body></html>
Here's a reference from the WDG on the topic:
[htmlhelp.com...]
It's an easy fix, and one well worth doing, IMO. Hey - if a dedicated SGML parser throws an error on it, who knows how a search engine spider will handle the same thing.