Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I create a button to enable javascript

Tags:

javascript

Is there any way to create a button to enable javascript if a user doesn't have it enabled?

If not, is there another way to enable javascript in the user's browser automatically when they visit our website?

Failing that, can I access the user's browser settings with permission and then enable javascript?

like image 413
Harsimar Avatar asked Jul 24 '26 06:07

Harsimar


2 Answers

No.

If a user has disabled JavaScript then there is no way for a website to do anything (other then provide instructions (e.g. in <noscript>)) to "help" them turn it on.

Given that people disabling JS are, increasingly, using third party tools (such as NoScript) to do so, providing instructions isn't likely to be helpful anyway. If a user has disabled JavaScript, then it is safe to assume that they understand the consequences of doing so and are capable of finding the On switch for themselves.

JavaScript can fail for other reasons though (such as a network problem while the JS file was downloading), so always be progressive and unobtrusive.

like image 150
Quentin Avatar answered Jul 25 '26 20:07

Quentin


Have you considered using a <noscript> tag?

<noscript>
     <div class="bigRedWarningBoxInMiddleOfScreen">
        Enable javascript pretty please
      </div>
</noscript>
like image 31
Brad M Avatar answered Jul 25 '26 19:07

Brad M



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!