i am having a application in which java script is must. but i am facing problem when at any client browser has java script disabled. i want a code using which i can check the browsers java script enabled/ disabled property so that the user cannot login until he enables javascript. can anyone help me in this code
+7
A:
You could simply have the "log in" button disabled by default and have it enabled by JavaScript when the document is loaded.
Also put a message saying the JavaScript is disabled on a page and make it visible by default. Upon document load, hide the message. Alternatively, use the <noscript>
tag.
Developer Art
2010-10-27 09:02:31
way to think out of the box :) +1
roman m
2010-10-27 09:04:12
but i need to give user a message about java script disable. otherwise he might not know what to do.
Sumit Gupta
2010-10-27 09:04:31
I'd also have a message directing a user to enable JS, which would be disabled by JS on page load
roman m
2010-10-27 09:05:00
@Sumit Gupta: have the message show up by default, and then hide it as you show the login button with JS.
roman m
2010-10-27 09:05:58
nice solution. +1
Stefanvds
2010-10-27 09:11:01
@roman m: thanks for code. it helped me a lot. easy n nice solution.
Sumit Gupta
2010-10-27 09:13:57
+1 @Sumit accept the answer, this is the way it should be done. Checking at the server side isn't reliable. As mentioned in the answer, use the <noscript> tag for whatever message you want to show to the user when javascript is disabled.
eglasius
2010-10-27 17:25:07