I was messing around with creating a popup message for if JavaScript is disabled. I'm using html, css, and bootstrap inside my project. I was wondering if there a way to detect if the html class inside my project was still "no-js"?
Asked
Active
Viewed 622 times
0
-
https://en.wikipedia.org/wiki/Unobtrusive_JavaScript – Quentin Oct 06 '15 at 14:13
-
How can you pop up a message when JavaScript is disabled? You should probably just rely on the ` – epascarello Oct 06 '15 at 14:26
-
You can create a popup box using html5 and css3. For an example of this you can go to [link](http://www.webdesignerdepot.com/2012/10/creating-a-modal-window-with-html5-and-css3/). – user3638890 Oct 06 '15 at 14:35
-
However the problem I'm running into is that it just prints the tags and everything else as just text whenever it's inside noscript. – user3638890 Oct 06 '15 at 14:36
-
Please take a look this answer. http://stackoverflow.com/questions/2489376/how-to-redirect-if-javascript-is-disabled – YuAn Shaolin Maculelê Lai May 17 '17 at 09:56
1 Answers
0
Use < noscript >
. If you aren't getting the results you want, your markup inside < noscript >
probably isn't correct.
Otherwise, if you want to know if a browser has disabled JS, an easy way would be to add an element to your < header >
, styled with a class that makes a pretty alert. Then, the first line of your JS would hide that element. The opposite way would be to select the element with CSS and display the alert, and then your first line of JS would be to hide the element.

Cruiser
- 1,618
- 2
- 16
- 20