View Full Version : code to enable users javascripts on page load?
kangaroobin
Mar 20th 2008, 10:46 am
does anyone know of a way to turn on users' javascript when they load my webpage without them approving to do so?
if not a way to tell them it needs to be on if it is off?
if it is off (haven't seen a computer that is to know what happens) what shows up in its place? note: I have a js slideshow
thanks!
vpguy
Mar 20th 2008, 3:08 pm
You have no control over whether or not the user has Javascript enabled. If this were possible it would be a HUGE security hole.
If you want something to be displayed to users who have Javascript disabled, use the <noscript> ... </noscript> tag, such as:
<noscript>This page requires Javascript in order to function properly. Please enable Javascript and refresh the page.</noscript>
Anything inside a <noscript> tag is not shown to people who have Javascript enabled. It only appears to the people who have it disabled.
kangaroobin
Mar 20th 2008, 4:13 pm
cool great thnx!
AstarothSolutions
Mar 20th 2008, 4:21 pm
It would be a major security hole if you could modify settings for a browser without their consent.
Decent code should work irrespective of things like javascript being turned on or off (if with minor elements not working ideally) but at a minimum should warn them that the site wont function correctly without javascript/ cookies etc being turned on
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.