This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
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
noscript is a block element, and thus can't be inside a <p>. You could use <div> instead, I suppose.
(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?
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
(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..