How do I tell if Javascript is enabled or disabled on IE v8

Anthony Lucia
Anthony Lucia used Ask the Experts™
on
How do I tell if Javascript is enabled or disabled on IE v8

What path do I take?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Dave BaldwinFixer of Problems
Most Valuable Expert 2014

Commented:
You have to assume that it is disabled and see that it is enabled only if your test script runs.  After all, if it is disabled, there is nothing to report it's condition.

Author

Commented:
I am getting the following error:

Javascript "void 0"

Open in new window


I looked up the error on a firum, which said to

1> Ensure the Pop-up blocker is off

2> Ensure the Javascript otpion is enabled

Open in new window


I have done the first, and wish to do the second

How can I ensure the that javascript option is enabled?
Fixer of Problems
Most Valuable Expert 2014
Commented:
In Internet Options on the Security tab for Internet, click on Custom and look for Scripting and Active Scripting under that to be set to 'Enable'.
Top Expert 2016
Commented:
save as javatest.html and run it in your browser
<html><head>
<meta name="description" content="JavaScript Tester">
<meta name="keywords" content="JavaScript, Tester">
<title>JavaScript Test</title>
</head>
<body>
<script type="text/javascript">  var jsvers = "*could not detect*" </script>
<script type="text/javascript">   jsvers="1.0" </script>
<script type="text/javascript1.1"> jsvers="1.1" </script>
<script type="text/javascript1.2"> jsvers="1.2" </script>
<script type="text/javascript1.3"> jsvers="1.3" </script>
<script type="text/javascript1.4"> jsvers="1.4" </script>
<script type="text/javascript1.5"> jsvers="1.5" </script>
<script type="text/javascript1,6"> jsvers="1.6" </script>
<script type="text/javascript1.7"> jsvers="1.7" </script>
<script type="text/javascript1.8"> jsvers="1.8" </script>
<script type="text/javascript1.9"> jsvers="1.9" </script>
<script type="text/javascript2.0"> jsvers="2.0" </script>
<script type="text/javascript2.1"> jsvers="2.1" </script>
<script type="text/javascript2.1"> jsvers="2.2" </script>
<table cellSpacing="0" cellPadding="7" align="center" style="margin-top:30px;">
		<tr>
			<td align="center" style="background-color:#616EA4; color:white; font-weight:bold; font-size:110%;" >Test Results</td>
		</tr>
		<tr>
			<td align="center" style="background-color:#D1E3F9;  padding:24px;
         border-left:3px solid #616EA4; border-right:3px solid #616EA4; border-top:3px solid #616EA4;">
			<span style="background-color:green; padding-top:8px; padding-bottom:8px;">
      <script type="text/javascript">
  	    document.write (" &nbsp; JavaScript &nbsp; <b>IS WORKING</b> &nbsp; in your web browser &nbsp;" );
      </script>
      	  <noscript>&nbsp; JavaScript <b>IS NOT WORKING</b> in your web browser &nbsp; 
			</noscript></span></td>
		</tr>
		<tr>
			<td style="background-color:#E9F0FA; border-left:3px solid #616EA4; padding-left:12px; padding-right:12px;
   border-right:3px solid #616EA4; border-bottom:3px solid #616EA4; line-height:200%;">
			<noscript>Either your web browser is not capable of supporting JavaScript at all &nbsp; -or-<br>
    the use of JavaScript has been purposely disabled.<br>
 		   </noscript>
 <script type="text/javascript">
  document.write ("Your web browser supports JavaScript version " + jsvers) ;
 </script>

 <script type="text/javascript">
 var detectedb = "not";
 if (window.opera) {detectedb = "Opera";}
 if (navigator.userAgent.indexOf("Firefox")!=-1){
       var endofff = navigator.userAgent.indexOf("Firefox")+8;
       detectedb = "Firefox";                  }
 if (navigator.userAgent.indexOf("MSIE")!=-1) {detectedb = "IE";}
 if (navigator.userAgent.indexOf(" Chrome/")!=-1){
       var endofChrome = navigator.userAgent.indexOf(" Chrome/")+8;
       detectedb = "Chrome";                     } //added Feb 28, 2010
 var uagentlowercase = navigator.userAgent.toLowerCase(); //force lower case
 if (uagentlowercase.search("blackberry") > -1)
 	 {detectedb = "BlackBerry";}   // added June 2, 2010
 var msg="<br>Your web browser is ";
 if (detectedb=="Opera")  {msg=msg+"Opera";}
 if (detectedb=="Firefox"){msg=msg+"Firefox version " + navigator.userAgent.substring(endofff,endofff+7);}

 if (detectedb=="IE")
 {msg=msg+"Internet Explorer ";
  if  (document.documentElement && typeof document.documentElement.style.maxHeight!="undefined")
// Is it IE7 or IE8 or IE9?
// {msg=msg+"7";}  old code, this used to only detect IE7, now it also wrongly detects IE8
   {if (navigator.userAgent.indexOf("MSIE 7.0") != -1) msg=msg+"version 7";
    if (navigator.userAgent.indexOf("MSIE 8.0") != -1) msg=msg+"version 8";
    if (navigator.userAgent.indexOf("MSIE 9.0") != -1) msg=msg+"version 9"; }
  else
      if (document.compatMode && document.all){msg=msg+"version 6";}
      else  if (window.attachEvent){msg=msg+" version 5";}
 }
 if (detectedb=="Chrome")
    {msg=msg+"Chrome version " + navigator.userAgent.substring(endofChrome,endofChrome+10);}
 if (detectedb=="BlackBerry")
    {msg=msg+"a BlackBerry of some type";}

 if (detectedb=="not")
      {document.write ("<br>Your web browser was not detected as being either Opera, Firefox, Internet Explorer, Chrome or a BlackBerry");}
 else {document.write (msg);}
</script>
			</td>
		</tr>
	</table>
	<p>&nbsp;</p>
	<p>Every web browser identifies itself to websites with a character string called the "user agent". The User
Agent string for your web browser is:</p>
	<p style="font-family:courier;">
<script type="text/javascript">
  document.write (navigator.userAgent);
</script>
<div>
	<script type="text/javascript">This function requires JavaScript.
	</noscript></p>
	<p class="screenonly">&nbsp;</p>
	<p class="screenonly">&nbsp;</p>
</div>
</body>
</html>

Open in new window

jstest.html

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial