?
Solved

Java Detect Not Working on Mac Firefox, Opera, Netscape

Posted on 2005-04-06
13
Medium Priority
?
506 Views
Last Modified: 2008-02-01
We have a website that uses a java-based map. We do a detect to see if java is installed before displaying the java map. If it is not installed, we display a static map. We use the following

function isJavaMap() {
 return ((navigator.javaEnabled()) && (GetCookie("maptype") != "image"))
}

It works on Windows IE, Nestcape, Opera, Firefox.

However, it does NOT work on Mac Firefox or Opera.

I have no idea why this is happening...can someone suggest an alternate java detection function that will work on all browsers.
0
Comment
Question by:jbreg
  • 7
  • 5
13 Comments
 
LVL 15

Expert Comment

by:aozarov
ID: 13721127
What does not work, navigator.javaEnabled() or GetCookie("maptype") != "image"?
Can you display the returned value from  both  navigator.javaEnabled()  and GetCookie("maptype")?
This site: http://www.skyzyx.com/scripts/java.php has a script (that basically detect java anbled in a similar way, but also adds the version) which works on Mac.
0
 
LVL 92

Accepted Solution

by:
objects earned 2000 total points
ID: 13721500
Most successful way we've used determine if Java was installed is to load an applet that checks that calls javascript once loaded. If no Java installed then the js never gets called.
Depending on your requirements the <object> tag may also provide the support you need for checking for an installed VM.
0
 
LVL 92

Expert Comment

by:objects
ID: 13721504
Every other method we have looked at fails on some platforms.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 

Author Comment

by:jbreg
ID: 13721531
Aoz, navigator.javaenabled returns false even when java is installed and enabled on Mac Firefox, etc.

Objects, do you have any sample code--or references for this method--seems reasonable to me. Our requirements are simply to detect whether any version of Java (msft or sun) is installed. Can you be more specific about the object method?
0
 
LVL 92

Expert Comment

by:objects
ID: 13721566

In the <object> tag you specify a clsid for the version required, or you can request any version.
That'll check only for Sun's VM though.

The <applet> tag will check if a VM is present, and display alternate HTML if not.

What action did you want to take if no VM is available.
0
 

Author Comment

by:jbreg
ID: 13721613
I want to refer users to an alternate page which gives instructions on how to install java, and gives the option to proceed to the static map. However, the problem still remains that our detection does not work properly on all platforms.

Do you have an actual sample or example of a detect that will work across all (or more than we have currently) browsers??
0
 
LVL 92

Expert Comment

by:objects
ID: 13721642
I don't have a live reference site at the moment, let me see what I can dig up for you.

or something to try would be to put an <object> tag in the noappet portion of the applet tag as the object tag supports redirecting or promping the user if no VM is installed.
0
 

Author Comment

by:jbreg
ID: 13724298
Do you have an example of the load an applet that calls javascript once loaded method?
0
 
LVL 92

Expert Comment

by:objects
ID: 13724410
No not live, but the following shows how to call javascript from your applet

http://www.apl.jhu.edu/~hall/java/JavaScript-from-Java.html

Though from the sounds of your requirements the <object> tag would handle it just fine without the need for an applet to test the version.
0
 

Author Comment

by:jbreg
ID: 13748038
That page only lists scripts compatible with certain browsers.

The best option I agree is to have a javascript function that calls an applet to load. If it does not load, then the function returns false. Anyone know of examples of a) the script and b) the applet???
0
 
LVL 92

Expert Comment

by:objects
ID: 13749414
> That page only lists scripts compatible with certain browsers.

It shows how to call javascript from Java which is what you need to do.

> Anyone know of examples of a) the script and b) the applet???

If the browser doesn't support Java->JS comms then it aint going to work regardless.

Did you try using the object tag?
0
 

Author Comment

by:jbreg
ID: 14433339
We eventually solved this using object's solution, which is to call an applet that basically does the following:

If it executes, it redirects the user to a page.

If the user times out, meaning it does not execute, we redirect to a diferent, no java page.

It's been foolproof.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses
Course of the Month7 days, 4 hours left to enroll

592 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question