Question

What would you do if your site visitors disabled JavaScript? Do you block them?

Was it helpful?

Solution

Ideally, you would use progressive enhancement which entails guaranteeing a base user experience and then adding all the flourishes for browsers that can handle them.

OTHER TIPS

you would degrade gracefully.

Indeed degrade gracefully. If that's not an option (anymore ;-)) then at least notify them with utilizing a <noscript> tag.

Use the NoScript tag to say "Hey, Enable Javascript fool!"

<script type="text/javascript">
       alert("Hello World!");
</script>
<noscript> 
       Hey, Enable Javascript fool!
</noscript>

(Please note that this is code is not ready deployment to your website. You can change the message to something more suitable than plain text.)

To couple with <noscript> I have all elements that require JS to function with class="js-required".

Then CSS: .js-required{display:none;}

JS on page load: $('.js-required').css('display','block')

Your website should be somewhat prepared if JavaScript is disabled, either display a message that your website works better with JavaScript enabled or work-around it.

For every site I build, I compare the cost of development for degrading gracefully, versus the loss of income by scaring off ~2-3% of the audience. Not caring about non-javascripters/Opera/etc usually wins...

If your visitors didn't know they have JavaScript disabled, a simple message would let them know they should enable it.

<noscript>Please enable JavaScript in your browser</noscript>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top