Humor me a bit here.
Why would I use <noscript>
in my pages? The alternative (at least, the one I use) is the Modernizr + no-js class combo that is utilized with (for example) the HTML 5 Boilerplate, and this has been sufficient in all use cases so far.
The only reason I can think of of using <noscript>
is to conditionally load resource files when JS is not enabled (most probably, CSS overrides?). I'm not sure if there a way to do that JS-free without using <noscript>
, but even that use case seems that it can be worked around of.
Yeah, <noscript>
is used to conditionally show / hide HTML elements to the client when Javascript is not available. I know that. You know that. Everyone who works with HTML should most likely know that.
However, there are a lot of other ways to do the same thing, most of which are preferred over <noscript>
. One is the html.no-js
class that Modernizr switches, which I mentioned above.
So the idea behind the question is more of, is there anything that <noscript>
can do for the web developer that is unique to it? That is, it's significant enough, but there's no other way to do it otherwise?
@Guffa below makes a good point with the advertisements.
Well, why should you? If you have no use for it, then just don't use it.
The noscript
tag is often used for fallback in advertisments and visitor tracking. If the user has Javascript disabled, a plain image is loaded instead of running the script.