469,276 Members | 1,692 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,276 developers. It's quick & easy.

Detect if JS is enabled

40
Hi all

I 'm writing a small web app and I would like to know what ways there are to check if the users' browser has JS enabled. I know I can create a page that redirects to a different page using JS but I was wondering if there is a better way of doing it, e.g. do it from the same page.

Thanks a lot
stack
Apr 8 '09 #1
4 2810
dmjpro
2,476 2GB
Have a look at this ;)
Apr 8 '09 #2
acoder
16,027 Expert Mod 8TB
I think that's exactly the kind of thing he wanted to avoid.

To detect if JavaScript is enabled, just put the code in script tags. Make it unobtrusive, i.e. not inline and the code will run if JavaScript is enabled and will be ignored if it's disabled.
Apr 8 '09 #3
stack
40
Thank you both for your answers. Yes acoder that was what I was trying to avoid :-). I don't know if you 're using gmail. If you try to login to your account and JS is disabled, the page won't load. This is what I would like to accomplish if possible.
Apr 8 '09 #4
acoder
16,027 Expert Mod 8TB
Add the page functionality using JavaScript (create elements dynamically) and a noscript message informing the user that they must enable JavaScript to use the page.
Apr 8 '09 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Christian Perthen | last post: by
23 posts views Thread by David McCulloch | last post: by
6 posts views Thread by NWx | last post: by
6 posts views Thread by Fred Hedges | last post: by
2 posts views Thread by Sergei Gnezdov | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.