Jordy
Jordy

Reputation: 4809

Waterproof method to block non-javascript users

Is there a waterproof method to block users that have disabled JavaScript in their browser?

If I do a check with cookies, a user can add a cookie manually.

I need this check because a JavaScript JQuery popupwindow should always be displayed, even when JavaScript is disabled.

Upvotes: 0

Views: 578

Answers (3)

Aleks G
Aleks G

Reputation: 57316

You can use noscript tag in your html with a redirect like this:

<noscript>
    <meta http-equiv="refresh" content="0;url=no-js.html" />
</noscript>

This way, if a user has disabled javascript, then he/she will be redirected to the no-js.html page, which you can customise as you please.

Upvotes: 6

wanovak
wanovak

Reputation: 6127

You could set certain elements, like a log-in perhaps, to display: none with CSS. With JavaScript, simply remove that style.

Or you can use this.

Upvotes: 1

Pantelis
Pantelis

Reputation: 6136

Use the no script tag

to display a huge div that will block the page, or trigger a redirect with ?

still it sounds like a hacky method, perhaps you should use the noscript tag to display a message that JS should be activated for the full experience and functionality?

Upvotes: 1

Related Questions