Forum Moderators: open

Message Too Old, No Replies

check if java is working

         

dtest

6:45 pm on Sep 2, 2008 (gmt 0)

10+ Year Member



I need to check if my visitors have java working. There is a page on my site that contains only a java applet and I want to automatically show information on how to install java only if the applet is not able to load (when the user has java disabled or not installed)

I already tried the following javascript:

<script type="text/javascript">
if(navigator.javaEnabled()){
document.write('Java is enabled');
}
else {
document.write('Java is not enabled');
}
</script>

but it's not acurate enough. it only tells if the user has java enabled in their browser options, it does not say if the user has java actually installed and if it's working

dtest

10:29 am on Sep 12, 2008 (gmt 0)

10+ Year Member



anyone?

Fotiman

3:49 pm on Sep 12, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I haven't found anything that looks to be too reliable. The closest I found was to set the *mayscript* attribute on the applet, then use JavaScript to call a method within the applet, wrapping the call in a try/catch block. A bit of a hack it would seem.

stajer

4:05 pm on Sep 12, 2008 (gmt 0)

10+ Year Member



Look at the specification for the applet tag for your java applet. You can include text that only displays if java is not installed on the machine

<applet ....>

<p>You do not have java installed. <a href="">Click here to get java</a>.
</applet>

dtest

4:47 pm on Sep 12, 2008 (gmt 0)

10+ Year Member



Look at the specification for the applet tag for your java applet. You can include text that only displays if java is not installed on the machine

<applet ....>

<p>You do not have java installed. <a href="">Click here to get java</a>.
</applet>

that doesn't work. it just displays a white box where the applet should be. At least on firefox it does. I've placed your code (plus an ending </p>) right under the <applet> tag.

DrDoc

5:21 pm on Sep 12, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you tried using the <object> tag instead? It is much better at fallback than <embed> or <applet>.

[w3.org...]