This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 5661 - <noscript> problem
Summary: <noscript> problem
Status: RESOLVED INVALID
Alias: None
Product: Validator
Classification: Unclassified
Component: Parser (show other bugs)
Version: HEAD
Hardware: Other All
: P2 normal
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: qa-dev tracking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-24 22:02 UTC by Andreas Yulius Nugroho
Modified: 2008-04-28 11:19 UTC (History)
0 users

See Also:


Attachments

Description Andreas Yulius Nugroho 2008-04-24 22:02:26 UTC
This following HTML code :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<title>Testing</title>
</head>
<body>
<p>
<script type="text/javascript">
<!--
document.write("Hello World!")
//-->
</script>
<noscript>Your browser does not support JavaScript!</noscript></p>
</body>
</html>

has 2 errors on validator output, using validator with 	XHTML 1.1 doctype.
Line 14, Column 10: character data is not allowed here . 
<noscript>Your browser does not support JavaScript!</noscript></p>
and
Line 14, Column 61: end tag for "noscript" which is not finished . 
ript>Your browser does not support JavaScript!</noscript></p>

I think :
1. the <noscript> has wrapped in a container element, <noscript> has no attribut, <noscript> is not using XHTML-style self-closing tags. So why the first error is occured?
2. i have closed the <noscript> tag properly. I also have closed the <p> tag properly. So why the second error is occured??

Do the code invalid or the validator's bug?
Thank you for giving me more and more reference on this problem.

Andre
Comment 1 Olivier Thereaux 2008-04-25 00:10:33 UTC
noscript is a block element, and thus can't be inside a <p>. You could use <div> instead, I suppose.
Comment 2 Andreas Yulius Nugroho 2008-04-25 05:07:27 UTC
(In reply to comment #1)
> noscript is a block element, and thus can't be inside a <p>. You could use
> <div> instead, I suppose.
> 

Thank you for replying.. I have change the <p> tag with <div> tag.. But still invalid... Still have 2 errors. Any reference please?? Just resolved as invalid?
Comment 3 Olivier Thereaux 2008-04-26 01:27:43 UTC
1) you need something inside the noscript, it can't contain content "just like that".
so something like <noscript><p>...</p></noscript>

2) you should't be using document.write in XHTML. Either use HTML, or don't use document.write.
http://www.w3.org/MarkUp/2004/xhtml-faq#docwrite
Comment 4 Andreas Yulius Nugroho 2008-04-28 11:19:28 UTC
(In reply to comment #3)
> 1) you need something inside the noscript, it can't contain content "just like
> that".
> so something like <noscript><p>...</p></noscript>
> 
> 2) you should't be using document.write in XHTML. Either use HTML, or don't use
> document.write.
> http://www.w3.org/MarkUp/2004/xhtml-faq#docwrite
> 
Thank you so much Oliver.. Your 2 points above prove that my code is invalid..