Link to home
Start Free TrialLog in
Avatar of Computer Guy
Computer Guy

asked on

How can I check to see if JavaScript is enabled, and if not display a message to the user: JS needs to be enabled

How can I check to see if JavaScript is enabled (when a page is loaded), and if not display a message to the user: JS needs to be enabled with a link (so I can have a page to say how to enabled javascript.
Avatar of enachemc
enachemc
Flag of Afghanistan image

ASKER CERTIFIED SOLUTION
Avatar of Rikin Shah
Rikin Shah
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I usually like to put someting in the HTML that shows the message, and hide it through Javascript. This way, if javascript is enabled, the message is not shown, and if javascript isn't enabled, the message is shown.

<script>
 function onLoadHide () //Fired on body onLoad event
  {
    document.getElementById("hideMe").display = 'none';
  }
</script>
.....
<div id="hideMe" >Javascript MUST be enabled</div>
Avatar of Computer Guy
Computer Guy

ASKER

How can I use the last example with <noscript>
<noscript> is not required in last example.