如何检测IE中是否启用了Java? [英] How to detect if Java is enabled in IE?

查看:479
本文介绍了如何检测IE中是否启用了Java?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:


我想进行检查以查看是否未安装Java或在IE中禁用或阻止了Java。



我尝试了 navigator.javaEnabled(),它在Firefox(v10 .0.2),但在IE8中返回TRUE。但是,IE会向用户显示提示:


您正在查看的页面使用Java。

Java支持
可从Microsoft网站获得。


我遇到的问题是,有一个复选框不再显示此消息 ,显然可以将其打勾,然后不再向用户提示未启用Java。



如何处理IE中缺少Java支持的问题?

解决方案


来自链接:


navigator.javaEnabled()不显示Java是否是已安装或
不在IE中。它只是告诉您applet标签是启用还是
禁用。



您可以在IE安全设置中禁用applet标签…工具->
Internet选项->安全->自定义级别-> Java权限->
禁用Java



这将导致javaEnabled()为false,而Java为仍然安装了
。因此,它也不被禁用。仅禁用applet
标签。



并从相同链接:


JRE(以前称为Java虚拟机或JVM)实际上更难处理
超出您的想象。确定是否已安装Java
很容易-快速调用navigator.javaEnabled()返回一个
简单布尔值。*问题在于检测版本和提供者
(Microsoft或Sun)。 / p>

我从没有找到令人满意的解决方案。要点是这样的:要使
获得此信息,您必须加载一个Java applet。


这里是另一个示例:



确定客户端浏览器是否已安装Java并可以启动applet


Possible Duplicate:
Determine whether client browser has java installed and can launch applets

I would like to run a check to see whether Java is not installed or if it's disabled / blocked in IE.

I have tried navigator.javaEnabled() and this works as expected in Firefox (v10.0.2), but in IE8 it returns TRUE. However, IE displays a prompt to the user:

The page you are viewing uses Java.
More information on Java support is available from the Microsoft website.

The issue I have with this is, there is a checkbox "Do not show this message again" that can obviously be ticked and then there would no longer be any prompt to the user that Java is not enabled.

How can I handle lack of Java support in IE?

解决方案

From this link:

navigator.javaEnabled() does not reveal whether Java is installed or not in IE. It merely tells you if the applet tag is enabled or disabled.

You can disable the applet tag in the IE security settings … Tools -> Internet Options -> Security -> Custom Level -> Java Permissions -> Disable Java

This will cause javaEnabled() to be false, yet Java is still installed. For that matter, it isn’t disabled either. Only the applet tag is disabled.

And from the same link:

The JRE (formerly Java Virtual Machine, or JVM) is actually more difficult to handle than you would think. Determining if Java is installed is easy—a quick call to navigator.javaEnabled() returns a simple Boolean.* The problem is detecting the version and provider (Microsoft or Sun).

I never found a satisfactory solution to this. The gist is this: to get this information, you must load a Java applet.

Here's another example:

Determine whether client browser has java installed and can launch applets

这篇关于如何检测IE中是否启用了Java?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆