Click to See Complete Forum and Search --> : Validation results


Aronya1
11-11-2003, 09:17 PM
Can anybody shed some light on this, please. I just validated a page & got some confusing results.
Here's the first:

Line 6, column 5: document type does not allow element "HTML" here (explain...).
<html>

Here's the source code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<html>
<head>

My best guess here is that if you use a doctype statement that includes "html" the actual <html> tag is not needed.(?)


Second thing I don't understand:

Line 43, column 162: end tag for element "FONT" which is not open (explain...).
...FONT COLOR=black SIZE=2>"+msg+"</FONT></TD></tr></TABLE>";

This is repeated for each of the closing tags, including the /table tag. Is this just because those tags aren't necessary? That can't be... how can you get away with not closing a table? I expect it has something to do with the javascript, but I'm clueless in that area.
Here is the code:

var content="<TABLE WIDTH=180 BORDER=1 BORDERCOLOR=red CELLPADDING=2 CELLSPACING=0 "+"BGCOLOR="+bak+"><tr><TD ALIGN=center><FONT COLOR=black SIZE=2>"+msg+"</FONT></TD></tr></TABLE>";

TIA for whatever help you can give.

PeOfEo
11-11-2003, 09:48 PM
drop the font tag and use css would be my suggestion to #2 and for #1 that meta tag needs to be in your head section, after your html and head tag.

Aronya1
11-11-2003, 10:40 PM
I should've seen the meta tag location. Thanks.

Want to take another look at the second problem? I get the same message for all 4 closing tags.


And, hey, don't you sleep?

DaveSW
11-12-2003, 02:38 AM
I've seen that problem before, and I think it's all to do with it being in the javascript part. I didn't find a solution last time tho.

Charles
11-12-2003, 04:52 AM
Originally posted by DaveSW
I didn't find a solution last time tho. 1) Put the JavaScript in an external file.

2) Escape the '/' a la document.write ('<p>Date:', new Date().toDateString(), '<\/p>').

Aronya1
11-12-2003, 01:08 PM
Originally posted by Aronya1
I expect it has something to do with the javascript, but I'm clueless in that area.
Key phrase: "I'm clueless in that area." Thanks Charles, for the suggestions. I understand what you mean in #1, even if I might not know how to accomplish it. But #2 is just Greek. I'm going to try changing the table to a div & see what happens.

DaveSW
11-13-2003, 07:01 AM
I think all he means is when you have a / - as in </p> then you need to put a \ in front of it to hide it. E.g </table> becomes <\/table>

Aronya1
11-13-2003, 11:52 AM
Thanks for that, Dave. I'll try it & see what happens.