• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 233
  • Last Modified:

Strange behaviour with Javascript detection

I have a simple HTML page which has some Javascript on to display the browser type on screen. At the end of the page i have <noscript> tags incase they dont have Javascript enabled.
Everytime i test this in Firefox and IE (by disabling/enabling Javascript) it works fine for me, however some of our users experience the following problems:
The javascript to display their browser type shows up perfectly fine then at the end of the page the <noscript> tags also executes and shows a message saying sorry but you hava no Javascript enabled. HOW can this possibly be that Javascript executes and then it says javascript is not available!?? In most cases users have had ZoneAlarm or some firewall but what would a firewall do to interfer with this?
Anyone got a clue whats going on?

  • 3
  • 2
1 Solution
Gurvinder Pal SinghCommented:
you should avoid using noscript

There are some recommended noscript settings, please see
guswebbAuthor Commented:
So are you saying that the best way to determine whether they have JS or not is to execute a function to see whether or not it works, if it works then JS is enabled otherwise if it doesnt work then its disabled?
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Gurvinder Pal SinghCommented:
Gurvinder Pal SinghCommented:
and there is a simple way

you can also save a cookie, so if the javascript is enabled, cookie will be saved, else it wont be.
guswebbAuthor Commented:
I prefer not to use Cookies, does this look like the best approach to resolve the issue then:

<div id="mainContent"> page content including JS output here</div>
<div id="noScript">JS IS DISABLED</div>

document.getElementById("mainContent").style.display= "inline";
document.getElementById("noScript").style.display= "none";

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.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now