Click to See Complete Forum and Search --> : Check if JS is ON


aoeguy
07-26-2003, 02:23 AM
I know its not Javascript, but HOW can you check if javascript is enabled and if not it must be enabled by the surfer or you must leave the site.

Hope someone knows

AdamGundry
07-26-2003, 03:21 AM
You could put an appropriate message in a <noscript> (http://www.w3.org/TR/html401/interact/scripts.html#edef-NOSCRIPT) element, I suppose...but as a rule, your site should not be dependent on Javascript to function. What about people using browsers which don't support JS?

Adam

aoeguy
07-26-2003, 04:30 AM
Well id doesnt NEED Javascript, but otherwise they could access my page without passwords.
I dont no what i would put in <noscript>, im no JS expert, but know a bit as i am VB programmer and know HTML.

AdamGundry
07-26-2003, 05:17 AM
A <noscript> element simply causes its contents to only appear if the user agent (browser) does not support scripting in general, or a script used on the page. You could put a message in it instructing users to leave, and generate links to the rest of your site using JS document.write() commands.

By the way, a Javascript login system is very insecure, and easily cracked. You're much better off with a server-side system which is more secure and allows the 13% of users who have JS disabled to access your pages.

Adam

aoeguy
07-26-2003, 11:05 AM
Well its not JS password protection, i got a service. And i need the to use right-click protection and referers otherwise a surfer can just type in the URL.

AdamGundry
07-26-2003, 11:45 AM
Like I said, it is insecure. Still, it's your choice.

aoeguy
07-26-2003, 11:56 AM
the site: My HP (http://myelfsoftware.e33.de)