逆向思维
 在APPLET里定义一public方法,用JS来调用,如果找不到对象,说明JVM未安装。
   否则。

解决方案 »

  1.   

    <SCRIPT LANGUAGE="JScript">
    if (window.clientInformation.javaEnabled() == true )
    // Java 已启用,可运行小程序。
    </SCRIPT>
      

  2.   

    javaEnabled Property  --------------------------------------------------------------------------------Retrieves whether the Microsoft virtual machine (Microsoft VM) is enabled.SyntaxXML N/A 
    Scripting [ bEnabled = ] clientCaps.javaEnabled Possible ValuesbEnabled Boolean that receives one of the following values: false Microsoft VM is not enabled. 
    true Microsoft VM is enabled. 
     The property is read-only. The property has no default value.ExampleThis example displays all the properties available through the clientCaps behavior.<HTML xmlns:IE>
    <HEAD>
    <STYLE>
    @media all {
    IE\:CLIENTCAPS {behavior:url(#default#clientCaps)}
    }
    </STYLE>
    <SCRIPT>
    function window.onload()
    {
    sTempStr = "availHeight    = " + oClientCaps.availHeight    + "\n" +
    "availWidth     = " + oClientCaps.availWidth     + "\n" +
    "bufferDepth    = " + oClientCaps.bufferDepth    + "\n" +
    "colorDepth     = " + oClientCaps.colorDepth     + "\n" +
    "connectionType = " + oClientCaps.connectionType + "\n" +
    "cookieEnabled  = " + oClientCaps.cookieEnabled  + "\n" +
    "cpuClass       = " + oClientCaps.cpuClass       + "\n" +
    "height         = " + oClientCaps.height         + "\n" +
    "javaEnabled    = " + oClientCaps.javaEnabled    + "\n" +
    "platform       = " + oClientCaps.platform       + "\n" +
    "systemLanguage = " + oClientCaps.systemLanguage + "\n" +
    "userLanguage   = " + oClientCaps.userLanguage   + "\n" +
    "width          = " + oClientCaps.width          + "\n" ;
    oPre.innerText = sTempStr;
    }
    </SCRIPT>
    </HEAD>
    <BODY>
    <H1>clientCaps Behavior Sample</H1>
    <P>This example shows how to use the new <B>clientCaps</B>
    behavior, introduced in Microsoft Internet Explorer 5, to obtain
    client capabilities information. The following is a sampling of the
    information that can be obtained:</P>
    <IE:CLIENTCAPS ID="oClientCaps" />
    <PRE id="oPre"></PRE>
    </BODY>
    </HTML>