Saturday, May 11, 2024
 Popular · Latest · Hot · Upcoming
118
rated 0 times [  124] [ 6]  / answers: 1 / hits: 62078  / 11 Years ago, tue, march 5, 2013, 12:00:00

I want to flag a message if javascript is disabled at client side. I searched here and found <noscript> tag to use for handling this stuff.



I did this at w3schools editor to check but its not working let me know if this <noscript> is not meant for this or something else I am missing in this part ?



enter


More From » noscript

 Answers
26

Try This :-



How to detect JavaScript is disabled in browser?


As we know, tag is used for JavaScript. Same way there is tag which gets in action when the JavaScripts disabled in browser.



<script>Put Sample code here for execution when JavaScript is Active </script>
<noscript>Put Sample code here for execution when JavaScript is Disabled</noscript>





How to handle disabled JavaScript in browser?



When JavaScript is disabled, Just tried to redirect to some page where we can display the message that Javascript is disabled. There is meta tag in HTML named “meta refresh” which will redirect the user to another page in the interval specified in that header.



<noscript>
<META HTTP-EQUIV=Refresh CONTENT=0;URL=ShowErrorPage.html>
</noscript>


As, we can see above code inside noscript, there is “meta refresh” tag with interval of “0″ second. As, the JavaScript is disabled in that page, the browser gets redirected to “ShowErrorPage.html” to show some warning message.



I hope this will help you.


[#79829] Monday, March 4, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
emiliano

Total Points: 381
Total Questions: 109
Total Answers: 93

Location: Jersey
Member since Fri, Oct 1, 2021
3 Years ago
emiliano questions
;