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
234 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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.
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…

735 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