檢查瀏覽器類型:      var navigatorAppName = navigator.appName;      if (navigatorAppName == "Netscape")
      {
        window.location.replace("NSCPTest.html");
      }
      else if (navigatorAppName == "Microsoft Internet Explorer")
      {
        window.location.replace("IETest.html");
      }
      else
      {
        window.location.replace("MiscTestSwing.html");
      }檢查IE版本:
      var IEVersion = navigator.appVersion;      if (IEVersion >= "4")
      {
        window.location.replace("IETestPlugin.html");
      }
      else
      {
        document.writeln("<h2>Improper Internet Explorer Version</h2><p>" +
        "Your Internet Explorer version does not support the APIWizard. Please" +
        "access this page with Internet Explorer 5 or higher.\n<p>");
      }調用Java Class檢查是否有裝JRE:  <OBJECT
    classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    width=1
    height=1
  >
  <PARAM
    NAME="java_code"
    VALUE="IEPluginFound.class"
  >
  <PARAM
    NAME="java_codebase"
    VALUE = "."
  >
  <PARAM
    NAME="archive"
    VALUE="APIWizardStartup.jar"
  >
  <PARAM
    NAME="type"
    VALUE="application/x-java-applet;version=1.2"
  >
IEPluginFound.javaimport java.applet.Applet;
import java.applet.AppletContext;
import java.io.PrintStream;
import java.net.MalformedURLException;
import java.net.URL;public class IEPluginFound extends Applet
{    public void init()
    {
    }    public void start()
    {
        String s = "IEPlugin.html";
        URL url = null;
        url = getCodeBase();
        try
        {
            url = new URL(url.toString() + s);
            getAppletContext().showDocument(url);
            return;
        }
        catch(MalformedURLException _ex)
        {
            System.out.println("Unable to create load file URL.");
        }
    }    public IEPluginFound()
    {
    }
}

解决方案 »

  1.   

    to passren(天哪!)你的意思是写一个applet小程序测试能够运行判断吗, 有错就没jre 对吗!问题:
    但是我想不需要applet小程序是否也可以判断呢
      

  2.   

    可以通过JavaScript检查,通过隐藏表单域提交到服务器。
      

  3.   

    如果只是提示没有虚拟机,如下即可
    <applet class="aaa.class" width="167" height="117">
    对不起,您的系统没有java虚拟机或者禁用了java Applet支持! 
    </applet> 判断版本这个还不够,可以考虑使用java script,也可以考虑使用applet运行后获得:)
      

  4.   

    我不需要提交服务器端,只需在客户端通过javascript脚本方法知道就行。我问各位是否可以访问注册表信息来确定是否IE安装了java虚拟机?
      

  5.   

    可以的 在HTML里调用一个微软的控件 系统本身就有的 然后怎么样怎么样, 不要说访问注册表 写都没问题 有些网站不是可以帮你修复注册表吗 好像就是这么实现的
      

  6.   

    只要是ie不禁用java脚本程序,你可以考虑使用提示窗口!其实没必要,你不妨将控件也下载到客户端,这样的话就省去了测试的过程了毕竟如果没有,照样不能运行阿!