How so? You can have the "noscript" content as the default (without <noscript>), and then modify the DOM with script to remove the "noscript" content and then do whatever the script was supposed to do.Jarvklo wrote: Well - this is IMHO unfortunate at best. It sort of makes it impossible to handle all aspects of eg. http://www.w3.org/TR/WCAG/#tech-scripts in XHTML5.
No, I meant you would do something like:Jarvklo wrote:Eh, - Now I'm even more confused. I wouldnt *dream* of placing a document.write based script inside of a <noscript> even in HTML4 !
- Code: Select all
<script>
document.write("foo");
</script>
<noscript>bar</noscript>
It only works in the sense that it hides the content, it will still be parsed as PCDATA in XML. Consider this example:Jarvklo wrote:[edit:] BTW when you say that <noscript> doesn't work in XHTML you surely must mean XHTML5? Seems to me it works just fine in XHTML 1.0 Strict served as application/xhtml+xml to at least some very common browsers like FireFox/Win and Opera/Win (you can try it out at the frontpage of http://xhtml.se if your browser indicates it prefers application/xhtml+xml over text/html)- or maybe I'm missing something obvious ? (in which case I'd be very geratful for some insightful references)
- Code: Select all
<form>
<noscript><input name="test" value="test"/></noscript>
<input type="submit"/>
</form>
So, "doesn't work" might be a bit of a stretch, especially since the same applies to e.g. <iframe>. Perhaps it shouldn't be disallowed in XHTML5?
As for a reference, search for "noscript" in the parsing section. (I believe this was either undefined in HTML4, or defined to be something different from what implementors do.)