Re: [VE] Question.
Jukka K. Korpela <jkorpela <at> cs.tut.fi>
2010-10-02 11:56:06 GMT
> These "error lines" are written by my hosting server and I can't see
> them with my html editor or notepad and I can't erase the lines.
You have 2 realistic options and 1 unrealistic option.
The unrealistic option is that you tell your hosting service provider that
they should inject their code in a manner that does not make the page
syntactically invalid. The fix might be technically simple, even trivial;
the tough, or impossible, part is to make someone out there understand the
issue _and_ take some trouble in actually fixing it.
The realistic options are:
1) get a better hosting service
2) live with the problem; learn to see which error messages relate to such
issues, and fix what you can fix.
> Validating http://www.cinecrack.com.ar/index.html
> Line 122, column 78: document type does not allow element "SCRIPT" here
When I run the validator on that page, I get such an error message as
relating to line 126. This may depend on content variation, as a server may
vary its response according to the request headers and other factors,
perhaps sending different content to different browsers, or depending on the
assumed country of the request, or the customer's shoe size. (I'm not
kidding; the shoe size might be stored in a cookie.)
But this is less relevant. The point is that the script element, apparently
added by the hosting server, appears after the html element, i.e. after the
end tag </html>, where no elements are allowed. Probably the server works
simplistically and just appends the analytics code to the document, not
caring about any validity, or even parsing HTML at all.
Well, if the end tags </body> and </html> are from your code, not inserted
by the server, then you have a simple and realistic 4th option: remove those
tags. Then the script element will be valid: it will be part of the body
element, which will be implicitly closed (together with the html element) by
the end of the document.
In HTML 4.01 (all versions), it is always valid (though _usually_ not
recommendable) to omit the end tags </body> and </html>.