How to know if the javascript was enabled in the user browser or not? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 8

How to know if the javascript was enabled in the user browser or not?

And if not, is there any way to enabled it?

2nd Sep 2016, 6:40 PM
Mohammed Chetehouna
5 Answers
+ 9
No, you can't enable it as you can not change somebody's browser's settings. You can use HTML <noscript> tag to display content only for users that have JS disabled in their browser.
2nd Sep 2016, 8:13 PM
Nenad__
Nenad__ - avatar
+ 5
thank you for answering. but I want to know how to check the user browser not mine.
2nd Sep 2016, 7:42 PM
Mohammed Chetehouna
+ 2
I got it thank you
3rd Sep 2016, 4:51 AM
Mohammed Chetehouna
0
yes if it isn't enabled u can enable it from settings & even check from the settings whether it's enabled or not
2nd Sep 2016, 7:19 PM
Henil Mamaniya
Henil Mamaniya - avatar
0
Create a global variable javascriptEnabled and set it to false by default. Then set this variable to true from a JavaScript block of code. If JavaScript is disabled, your code wouldn't run and the variable value will remain false. However, I'm not sure how it would help you. If JavaScript is disabled, you can't run any code to do something conditionally based on it.
3rd Jan 2017, 2:14 AM
Igor B
Igor B - avatar