Solved

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

Posted on 2011-03-16
7
229 Views
Last Modified: 2012-05-11
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.
0
Comment
Question by:Computer Guy
7 Comments
 
LVL 12

Expert Comment

by:enachemc
ID: 35145111
0
 
LVL 19

Accepted Solution

by:
Rikin Shah earned 500 total points
ID: 35145137
<script type="text/javascript">
document.write("hi!")
</script>
<noscript>
<p>
Text which says "JS needs to be enabled"
and
<a href="somewhere">Link</a>
</p>
</noscript>
0
 
LVL 10

Expert Comment

by:Asim Nazir
ID: 35145149
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 9

Expert Comment

by:mayank_joshi
ID: 35145153
0
 
LVL 19

Expert Comment

by:Bardobrave
ID: 35146065
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>
0
 
LVL 3

Author Comment

by:Computer Guy
ID: 35146097
How can I use the last example with <noscript>
0
 
LVL 19

Expert Comment

by:Rikin Shah
ID: 35146134
<noscript> is not required in last example.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now