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
236 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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…

707 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