code to enable users javascripts on page load?

Discussion in 'JavaScript' started by kangaroobin, Mar 20, 2008.

  1. #1
    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!
     
    kangaroobin, Mar 20, 2008 IP
  2. vpguy

    vpguy Guest

    Messages:
    275
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    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>
    
    Code (markup):
    Anything inside a <noscript> tag is not shown to people who have Javascript enabled. It only appears to the people who have it disabled.
     
    vpguy, Mar 20, 2008 IP
  3. kangaroobin

    kangaroobin Peon

    Messages:
    170
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    cool great thnx!
     
    kangaroobin, Mar 20, 2008 IP
  4. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #4
    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
     
    AstarothSolutions, Mar 20, 2008 IP