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  :)

Link to comment
Share on other sites

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);)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.