PDA

View Full Version : Multiple <html> tags in one document?



JoeP
09-27-2009, 08:50 AM
I just noticed that a connect.gramin.com document I was looking at contains nested <html> tags. I've never seen this before. Does anyone know what the purpose / effect of this coding style is?
The document has a form something like this:
<html>
<head>
</head>
<body>
<div>
<html>
<body>
<div>
<html>
<body>
<div>
</div>
</body>
</html>
</div>
</body>
</html>
</div>
</body>
</html>

for example, see http://connect.garmin.com/activity/12971963

Thanks,
joe

farcaster
09-27-2009, 09:06 AM
I actually did this to my own code once before I realized the mistake.

I was using .php files so I could set up and use some common includes. The problem was that the include php files actually started life as html files. I failed to remove the doctype, head/head, etc stuff when I made them .php's.

I don't know if it would pass a validator - I never tried - but it appears to work. Ugly stuff though if you ever have to debug the code in realtime.

JoeP
09-27-2009, 09:47 AM
I actually did this to my own code once before I realized the mistake.

I was using .php files so I could set up and use some common includes. The problem was that the include php files actually started life as html files. I failed to remove the doctype, head/head, etc stuff when I made them .php's.

I don't know if it would pass a validator - I never tried - but it appears to work. Ugly stuff though if you ever have to debug the code in realtime.

You're right, this does not pass validation. Many of the validation errors are due to html and body tags not allowed where they are found.
joe

JamesYap
10-03-2009, 02:56 AM
Wahahaha, I think I can use the phase that I have seen many times when discussing Garmin products -

"Welcome to the world of Garmin!" :D