Recognizing a Browser's Java Support


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6

Thread: Recognizing a Browser's Java Support

  1. #1
    Join Date
    Aug 2005
    Posts
    7

    Recognizing a Browser's Java Support

    Greetings!

    I need to find out how a web page can find out if a browser supports Java. The recognition of a browser's Java support should help me to prevent the gray display of Java applets if the browser does not support Java.

    Thanks for your time and help,

    Sven Littkowski

  2. #2
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    1,560
    I found this snippet:
    Code:
    <script language="JavaScript"><!--
    if (navigator.appName == 'Microsoft Internet Explorer' && navigator.appVersionindexOf('MSIE 3'))
        var java = false;
    else
        var java = navigator.javaEnabled();
    //--></script>
    If you do this in the initial phaze of the web page you may open another page
    or change the html via javascript.
    Last edited by sjalle; 10-16-2005 at 06:25 PM.
    eschew obfuscation

  3. #3
    Join Date
    Aug 2005
    Posts
    7
    Hello S. Jalle,

    many sincere thanks for your speedy response. But I believe that this Java code (which again requires Java acceptance) does nothing else then only testing for the IE browser version. It actually says nothing else than: "If it is the IE version 3 (or before) than just don't use Java".

    Thanks, still, for your help. However, I am still open and thankful for further helps, suggestions and Kentucky Fried Chickens, everyone is welcome to help me!

    Greetings,

  4. #4
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    1,560

    Cool Oh ?

    Code:
    var java = navigator.javaEnabled();
    The code line above test wether java is supported & enabled in the current
    browser. This feature was added at JavaScript 1.1

    But I believe that this Java code (which again requires Java acceptance)...
    Its javascript.

    Ps: Is the problem the redirection to another page ?
    Last edited by sjalle; 10-17-2005 at 05:44 AM.
    eschew obfuscation

  5. #5
    Join Date
    Aug 2005
    Posts
    7
    Hi, Jalle.

    No, not the redirection is the problem. I just wonder if someone can disable Java so entirely that even this code you just listed wouldn't work anymore, not surer about it.

    I know Java applets would be disabled. But would the disabled Java cause even simple, open Java script not to work anymore? Or would the simple Java script still work?

    Greetings,

    Sven

  6. #6
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    1,560

    Hi, the nick sjalle....

    ...and the problem is javascript, not java. There is no connection
    between a browsers java applet capabilities and the browsers javascript
    capabilities.

    But they have one thing in common, the letters "java".

    The java applet is run by the java vm, the javascript is
    interpreted by the browser. It is possible to disable javascript for a
    browser, but I hesitate to call that a functional browser....

    The various browsers disagree on the way they
    have implemented javascript, but thats another ballgame...
    eschew obfuscation

Similar Threads

  1. learning c# very confusing.
    By Mike Tsakiris in forum .NET
    Replies: 11
    Last Post: 10-04-2002, 05:32 PM
  2. JAVADOTNET !!!
    By Dharmesh in forum .NET
    Replies: 4
    Last Post: 10-01-2001, 03:47 PM
  3. Re: ALERT - XP COULD DISABLE JAVA IN WEB BROWSERS AND EMAI L
    By Tim Romano in forum Talk to the Editors
    Replies: 1
    Last Post: 07-27-2001, 08:05 AM
  4. ALERT XP COULD DISABLE JAVA IN WEB BROWSERS AND EMAIL
    By Debbie Locker in forum Talk to the Editors
    Replies: 8
    Last Post: 07-24-2001, 07:50 PM
  5. Replies: 0
    Last Post: 07-18-2001, 08:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center