How to prevent website use without JavaScript enabled?

Hi All,

I would like to prevent people from using my website when they don’t have java script enabled. Can anyone point me to a document that describes how to do this or maybe a simple setting ? I have seen several examples on the internet but none of the worked nor where the specific to a liquid environment.

Any help would be appreciated!

Thank you!

Here is one way to do it:

In your theme.liquid layout find the <body ..> tag and modify like this:


    
...

The point here is to assign a no-js class on the body element and then, piece of javascript code will remove it and assign class js to the body element.

CSS rule will output a message on white background until javascript code is run.

Be sure to keep other attributes of the body intact, just modify the class.

HI TIm, Thank you for the reply. I tired your solution and it didn’t work. Still have full access when JavaScript is disabled. I don’t see any difference with it enabled or disabled.

And you can provide a (preview) link to a site where my code is added and does not work?