javaEnabled() method

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ruskin

    javaEnabled() method

    I'm confused (that's not too difficult to do)... But I read the write-up on
    the javaEnabled() method;
    window.navigato r.javaEnabled()
    States; the return value indicates if the preference that controls java is
    turned on or off. It does NOT indicate if the browser supports java.

    Ok, so if the user has java turned off, you can't run that method anyway!!!!
    How do I tell if the user has java turned on or off and if the browser
    supports java. Using this method, I can see if java is enabled, but there is
    no way to tell if java is not enabled (either by the browser or by the user
    turning it off). I have tried the <noscript> tag as well, but that doesn't
    help....

    What I am trying to do, is redirect the user to a different page, if there
    browser is not capable of running java, or if they have java turned off.....









  • Ruskin

    #2
    Re: javaEnabled() method

    OK.. Have answered my own question.. This seems to work;

    <script language="javas cript">
    if (navigator.java Enabled() == true) {
    if (browserSupport ed() == false) {
    window.location = "notsupported.a sp?reason=brows er";
    }
    } else {
    window.location = "notsupported.a sp?reason=scrip t";
    }
    </script>

    <noscript>
    <!-- java is supported by the browser, but has been turned off.... -->
    <meta http-equiv="Refresh"
    content="0;url= notsupported.as p?reason=disabl ed">
    </noscript>


    "Ruskin" <ruhardie@nospa m.xtra.com> wrote in message
    news:7pPxc.429$ s52.21589@news. xtra.co.nz...[color=blue]
    > I'm confused (that's not too difficult to do)... But I read the write-up[/color]
    on[color=blue]
    > the javaEnabled() method;
    > window.navigato r.javaEnabled()
    > States; the return value indicates if the preference that controls java is
    > turned on or off. It does NOT indicate if the browser supports java.
    >
    > Ok, so if the user has java turned off, you can't run that method[/color]
    anyway!!!![color=blue]
    > How do I tell if the user has java turned on or off and if the browser
    > supports java. Using this method, I can see if java is enabled, but there[/color]
    is[color=blue]
    > no way to tell if java is not enabled (either by the browser or by the[/color]
    user[color=blue]
    > turning it off). I have tried the <noscript> tag as well, but that doesn't
    > help....
    >
    > What I am trying to do, is redirect the user to a different page, if there
    > browser is not capable of running java, or if they have java turned[/color]
    off.....[color=blue]
    >
    >
    >
    >
    >
    >
    >
    >
    >[/color]


    Comment

    • Lee

      #3
      Re: javaEnabled() method

      Ruskin said:[color=blue]
      >
      >I'm confused (that's not too difficult to do)... But I read the write-up on
      >the javaEnabled() method;
      >window.navigat or.javaEnabled( )
      >States; the return value indicates if the preference that controls java is
      >turned on or off. It does NOT indicate if the browser supports java.
      >
      >Ok, so if the user has java turned off, you can't run that method anyway!!!!
      >How do I tell if the user has java turned on or off and if the browser
      >supports java. Using this method, I can see if java is enabled, but there is
      >no way to tell if java is not enabled (either by the browser or by the user
      >turning it off). I have tried the <noscript> tag as well, but that doesn't
      >help....
      >
      >What I am trying to do, is redirect the user to a different page, if there
      >browser is not capable of running java, or if they have java turned off.....[/color]

      You're confused about what Java is.
      It's not Javascript, which is probably what you're really interested in.
      Java is a completely different language.

      Think about your problem from the other direction.
      Redirect those who *do* have Javascript installed and enabled.

      Comment

      • Richard Cornford

        #4
        Re: javaEnabled() method

        Ruskin wrote:[color=blue]
        > I'm confused[/color]
        <snip>

        Fundamentally. Java and javascript are distinct programming languages
        that share nothing but some letters in their names and syntaxes
        reminiscent of C.
        [color=blue]
        > States; the return value indicates if the preference that controls
        > java is turned on or off. It does NOT indicate if the browser
        > supports java.
        >
        > Ok, so if the user has java turned off, you can't
        > run that method anyway!!!![/color]

        it may be possible to execute javascript code when Java is disabled or
        unavailable they are independent system that just have the potential to
        interact.

        <snip>[color=blue]
        > Using this method, I can see if java is enabled,[/color]

        That is not what the document you found says.
        [color=blue]
        > but there is no way to tell if java is not enabled (either
        > by the browser or by the user turning it off). I have tried the
        > <noscript> tag as well, but that doesn't help....[/color]

        NOSCRIPT tags relate to javascript not Java, but have little or no
        practical application as they represent a non-useful relationship with
        the successful execution of scripts.
        [color=blue]
        > What I am trying to do, is redirect the user to a different page, if
        > there browser is not capable of running java, or if they have java
        > turned off.....[/color]

        Java or javascript (if the answer is Java you are asking in the wrong
        place) and _why_?

        Richard.


        Comment

        Working...