Jump to content

Noscript Demands A P Tag Inside It Even When Encased In P Tags?


Charamei

Recommended Posts

I've just installed IntenseDebate into my fledgling website, and am trying to post a comments link on the same line as some other information. Example:

December 11th, 2009 by Catherine Russell: 0 comments
(Where underlined text is a link to the comments below). This works perfectly. However, ID runs off JavaScript - including the '# comments' link. I would therefore like to have the link change to something more useful, such as 'comments disabled', when people have scripting disabled.I've tried this:
<p class="meta">December 11th, 2009 by Catherine Russell: <script type="text/javascript" src="http://www.intensedebate.com/js/genericLinkWrapperV2.js"></script><noscript>comments disabled</noscript></p>

But the XHTML validator returns an error and tells me that the 'comments disabled' text must be inside <p> tags. This is fair enough, except that it results in 'comments disabled' appearing on a new line rather than on the same line as the rest of the text - which looks disjointed and messy. As you can see, the whole thing is already encased in a <p> tag.One of the pages in question (the one I'm stealing examples from) is here. My lorem ipsum is showing, please excuse.Is there any way to have my cake and eat it too, or is this a case where I'm going to have to choose between accessibility and aesthetics?

Link to comment
Share on other sites

I'm surprised the validator allows a <p> inside a <p>. That's supposed to be wrong. Maybe it doesn't bark because the <noscript> element throws it off.Anyway, try giving the no-script paragraphs a class name. Then your CSS can redefine that paragraph class anyway you like. Probably the most important thing will be this: display:inline, which should keep it from starting a new line and having a newline start when it's done.

Link to comment
Share on other sites

They just mean that you can't put a text node directly under a <noscript> tag. It has to be inside any block element. It can be <p> but it could be a <div> as well.

Link to comment
Share on other sites

Thank you both. <div style="display: inline;"> fixed it up nicely.

I'm surprised the validator allows a <p> inside a <p>. That's supposed to be wrong. Maybe it doesn't bark because the <noscript> element throws it off.
Yes, it confused me, too. Strange things the validator does sometimes.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...