Trialcoder Trialcoder - 1 year ago 125
Javascript Question

Show message if javascript disabled on client side using noscript tag

I want to flag a message if javascript is disabled at client side. I searched here and found

tag to use for handling this stuff.

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

enter image description here

Answer Source

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.

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

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download