NOTE: The current preferred location for bug reports is the GitHub issue tracker.
Bug 925 - Noscript Error in head
Noscript Error in head
Status: RESOLVED INTENTIONAL
Product: Validator.nu
Classification: Unclassified
Component: Browser-based UI
HEAD
All All
: P2 normal
Assigned To: Nobody
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-05 17:07 CEST by Vineet Gupta
Modified: 2012-06-05 17:21 CEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vineet Gupta 2012-06-05 17:07:41 CEST
According to the HTML5 clause 4.3.2 
"In a head element, if scripting is disabled for the noscript element. The noscript element must contain only link, style, and meta elements."

And I had tried to do the following thing and it has showed the error:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:html5="http://www.w3.org/1999/xhtml" xml:lang="en-GB">
<head>
<title>Demo of NoScript Error</title>
<noscript>
<link rel="stylesheet" type="text/css" href="../css/1200.css" />
</noscript>
</head>
<body>
Hello World!!!
</body>
</html>


The error shown as:

"Validation Output: 1 Error
Line 6, Column 10: XHTML element noscript not allowed as child of XHTML element head in this context. (Suppressing further errors from this subtree.)
<noscript>
Contexts in which element noscript may be used:
In a head element of an HTML document, if there are no ancestor noscript elements.
Where phrasing content is expected in HTML documents, if there are no ancestor noscript elements.
Content model for element head:
If the document is an iframe srcdoc document or if title information is available from a higher-level protocol: Zero or more elements of metadata content.
Otherwise: One or more elements of metadata content, of which exactly one is a title element.
"

Kindly Let me know how to validate this thing


Regards,
Vineet Gupta
Comment 1 Michael[tm] Smith 2012-06-05 17:21:23 CEST
Note the part where the error message says, "... of an HTML document".

If you are serving your content as XHTML with an XML MIME type (or manually setting the validator presets to check it as such), your document is not a HTML document, it's an XHTML document. And <noscript> is not allowed in XHTML documents (because XML parsers can't handle <noscript> correctly).