Jump to content

[SOLVED] JavaScript to check java installed or not


Basit

Recommended Posts

Hi to all  ;),

Hope you all will be fine. I have a java applet which i call in php file, for applet to run you must install java. Actually i want to write a script(php, javaScript) before calling applet that check whether java is installed in the system or not, if installed then call the applet otherwise in place of applet show a link on which when you click it redirect to you java website. Is it possible? If it is then how can i do this please help.

I just know that PHP can't do it so now i want to write javascript. Can any one help

Thanks in advance  :)

Hi friends  ;D

Hope you all are fine. I did it by little bit Googling with the code

 

<body>
<script language="Javascript" type="text/javascript">
     if(!navigator.javaEnabled()){
          alert('Enable your java to expeirience this java enhanced page or\n             try install it...');
         window.open('InstallingJAVA.html');
          //location.replace('http://java.sun.com');
         location.replace('InstallingJAVA.html');
    }
</script>
<noscript>
Enabled javascript please
</noscript>

<?php

$applet='<APPLET CODE = "Applet.class" ARCHIVE = "Applet.jar" WIDTH = "240" HEIGHT = "210" NAME = "xxxxxx" MAYSCRIPT = true>
    
  
    <PARAM NAME="uid"  VALUE="'.$id.'">
    <PARAM NAME="uname"    VALUE="'.$uname.'">

</APPLET> ';
echo $applet;

?>
</body>
</head>

 

Thanks to everyone chill  8);)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.