guswebb
asked on
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?
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?
you should avoid using noscript
http://javascript.about.com/od/reference/a/noscriptnomore.htm
There are some recommended noscript settings, please see
http://forums.informaction.com/viewtopic.php?f=7&t=2110
http://javascript.about.com/od/reference/a/noscriptnomore.htm
There are some recommended noscript settings, please see
http://forums.informaction.com/viewtopic.php?f=7&t=2110
ASKER
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?
and there is a simple way
http://www.boutell.com/newfaq/creating/detectjs.html
you can also save a cookie, so if the javascript is enabled, cookie will be saved, else it wont be.
http://www.boutell.com/newfaq/creating/detectjs.html
you can also save a cookie, so if the javascript is enabled, cookie will be saved, else it wont be.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Check below url may help you :
http://blog.blazed-designs.com/2009/05/05/jquery-javascript-detection/