scm0sml
asked on
programmatically detecting javascript enabled
Hi,
I need a way of detecting in my code behind if possible if javascript has been enabled or disabled.
There seem to be lots of examples of detecting if a browser is capable but I need to know if it is actually switched in or out.
Any ideas?
I need a way of detecting in my code behind if possible if javascript has been enabled or disabled.
There seem to be lots of examples of detecting if a browser is capable but I need to know if it is actually switched in or out.
Any ideas?
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
is there way of automatically redirecting within <noscript>?
I don't want the user to be aware of what is going on so if javascript is disabled then they automatically get redirected to another page......?
I don't want the user to be aware of what is going on so if javascript is disabled then they automatically get redirected to another page......?
this line will redirect to your page how enable the script within 2 second
<meta http-equiv="refresh" content="2; URL=RedirectPageHere.html" >
-------------------------
http://www.plus2net.com/javascript_tutorial/javascript_support.php
<meta http-equiv="refresh" content="2; URL=RedirectPageHere.html"
-------------------------
http://www.plus2net.com/javascript_tutorial/javascript_support.php
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
mmmm the re-direct works fine.
I was hopinh to redirect to the same page but passing in a param js=off.
The problem is it gets stuck in an infinite loop.....
I was hopinh to redirect to the same page but passing in a param js=off.
The problem is it gets stuck in an infinite loop.....
you can not redirect to the same page since <noscript> will be in the head section and the browser will execute first
what you can do is setting up a landing page such as env.html from this page depend on the javascript enable or not you will redirect them to the right page or add the right parameter to pass onto redirect page
let's say you have default.html as of right now
so from default.html
<noscript> redirect to home.html?js=off</script>
<script>
yes
redirect home.html?js=on
</script>
what you can do is setting up a landing page such as env.html from this page depend on the javascript enable or not you will redirect them to the right page or add the right parameter to pass onto redirect page
let's say you have default.html as of right now
so from default.html
<noscript> redirect to home.html?js=off</script>
<script>
yes
redirect home.html?js=on
</script>
try to use the noscript with with message or redirection when script disable
more on this.
http://www.plus2net.com/javascript_tutorial/javascript_support.php