Noscript Tag, JavaScript Disabled Warning and Google Penalty Noscript Tag, JavaScript Disabled Warning and Google Penalty javascript javascript

Noscript Tag, JavaScript Disabled Warning and Google Penalty


Put the <noscript> content at the end of your HTML, and then use CSS to position it at the top of the browser window. Google will no longer consider it important.

Stack Overflow itself uses this technique - do a View Source on this page and you'll see a "works best with JavaScript" warning near the end of the HTML, which appears at the top of the page when you switch off JavaScript.


<noscript> is not meant for meaningless warnings like:

<noscript>
Oh, no! You don't have JavaScript enabled! If you don't enable JS, you're doomed. [Long explanation about how to enable JS in every browser ever made]
</noscript>

It's meant for you to provide as much content as you can, along with a polite mention that enabling JS will provide access to certain extra features. You'll find that basically every popular site follows this guideline.


I don't think using <noscript> is a good idea. I've heard that it is ineffective when the client is behind a JavaScript-blocking firewall - if the client's browser has JavaScript enabled the <noscript> tag won't activate, because, as far as the browser's concerned, JavaScript is fully operable within the document...

A better method IMO, is to have all would-be 'noscript' content hidden by JavaScript.

Here's a very basic example:

...<body>    <script>        document.body.className += ' js-enabled';    </script>    <div id="noscript">        Welcome... here's some content...    </div>

And within your StyleSheet:

body.js-enabled #noscript { display: none; }

More info: