Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check browser's JavaScript is enabled or not

My application depends on JavaScript, I want to check the client browser's JavaScript is enabled or not and raise an alert message if its turned off.

like image 243
Simhadri Avatar asked Sep 17 '10 21:09

Simhadri


People also ask

Is Chrome a JavaScript enabled browser?

On Google Chrome, JavaScript is enabled by default, but you can verify if it works through the Settings menu. To reveal the Settings menu, simply click on three tiny black dots at the top-right corner of your Chrome window.


1 Answers

There's actually a <noscript> tag that you can use to display the content contained inside when javascript is not available.

Something like:

<noscript>
    <div>
        You must enable javascript to continue.
    </div>
</noscript>

The div just won't show if they have javascript, and it's pretty easy to tell if javascript IS working, no matter whether you need it to ping your server back to let it know, or use it to perform some more advanced functions.

like image 66
Nathan Wheeler Avatar answered Nov 03 '22 09:11

Nathan Wheeler