昨天上头说要用js检测一下浏览器的信息和客户端JRE信息。
关于浏览器的信息,js内置对象navigator可以取出来。
关于JRE的信息,可以使用Java Deployment Tools中的deployJava.js,
下载地址:http://www.java.com/js/deployJava.js
相关的注释版本:http://www.java.com/js/deployJava.txt
该文件提供了提取和处理客户端浏览器的简单调用,很大程度上简化在网页上启动applet的工作量。
deployJava.getJREs()方法可以返回客户端已经安装的JRE环境列表。
但是有一个美中不足的地方,它无法识别该客户端的JRE哪些在使用,哪些是已经被禁用了,也没办法识别当前使用的是那个JRE。
比如,有一台机器上的JRE情况如下:
1.6.xx disable
1.5.xx enable
此时,getJREs()会返回2个对象(1.5, 1.6),即使1.6这个时候已经被系统禁用了。在这种情况下,如果根据getJREs()的结果而启动1.6 only的applet版本,就会造成错误。
来看看
getJREs()代码:
if (deployJava.isPluginInstalled()) {
var plugin = deployJava.getPlugin();
var VMs = plugin.jvms;
for (var i = 0; i < VMs.getLength(); i++) {
list[i] = VMs.get(i).version;
}
} else {
.....
}
并未发现对jre启用情况的分析。
如果可以获取到JRE启用情况,那就更好了。
分享到:
相关推荐
This short guide will help you develop applications using JavaScript and Node.js, leverage your existing programming skills from .NET or Java, and make the most of these other platforms through ...
This short guide will help you develop applications using JavaScript and Node.js, leverage your existing programming skills from .NET or Java, and make the most of these other platforms through ...
用来检测JRE的JS工具,使用JS来获取JRE版本、及更新等
gitlab-ci-cd-templates:用于Java python和nodejs的gitlab CICD管道模板\ n Java python及node.js项目gitlab CICD模板
java.lang.NoSuchMethodException: org.apache.catalina.deploy.WebXml addServlet 解决方法:Tomcat安装文件context.xml里的Context标签中添加即可解决该问题。 java.lang.NoSuchMethodError: org.apache....
客户关系管理演示这是一个简单的展示,展示了如何使用 Angular.js 和 Java EE 6(JAX-RS 和 JPA 2.0)构建 Web 应用程序。 要部署,只需将 war 复制到 Jboss AS 7.1 的“standalone/deployments”目录。 您还可以...
You can check the status variable of the applet while it is loading to determine if the applet is ready to handle requests from JavaScript code; see Handling Initialization Status With Event Handlers....
by-step instructions, web developers and frontend engineers familiar with React will learn how to build and style interfaces, use mobile components, and debug and deploy apps. You’ll learn how to ...
执行命令./bin/deploy-backend来发布后端应用程序。 为了进行调试,您可以直接运行WebAppBoot.java。 对于前端应用程序:将Vue.js用于ViewModel,将Webpack用作模块捆绑器,将Express用作前端服务器,将PM2用作Node...
Get a practical introduction to React Native, the JavaScript framework for writing and deploying fully featured mobile apps that render natively. The second edition of this hands-on guide shows you ...
Windouws 64 位Tomcat7.0.40 + 64位jdk1.7.0u21 绿色版 part1 纯绿色,官方下载,绝对可用~ 欢迎评论吐槽~ ...│ │ │ │ deployJava1.dll │ │ │ │ npdeployJava1.dll │ │ │ │ │ │ │ ...
用javascript做的一个中学语文学习的小项目,主要用到javascript操作xml,javascript实现分页,javascript和html脚本实现图片拖拽
WebRTC 点对点视频通话系统 主要功能: 1、基于websocket的在线用户列表;...java.lang.NoSuchMethodException: org.apache.catalina.deploy.WebXml addServlet 解决方法:Tomcat安装文件context.xml
它将监视您工作区中部署的 portlet 的资源(.jsp、.js、.css、.tag、.vm、.jspf)、jsp-hooks 和 java 代码,并在更改时热复制它们,而无需重新部署. (保持 permgen 问题在海湾) 它还提供了 liferay 'deploy' ...
Instead of learning Swift for ios and Java for Android, just learn JavaScript and make apps for ALL platforms using Apache Cordova. This book also covers everything you need to know in order to use ...
由于它是完全在Node.js中实现的,因此您不必再设置Force.com迁移工具(Ant,Java)。 设置 $ npm init $ npm install grunt grunt-jsforce-deploy --save-dev 例子 项目目录 ├── Gruntfile.js ├── package....
Develop and deploy applications using the OSGi-based runtime container, Apache Karaf Overview Understand Apache Karaf’s commands and control capabilities Gain familiarity with its provisioning ...
更改为jspi-core项目并执行mvn clean install或mvn deploy 。 请注意,在构建项目时,您可能需要跳过测试。 添加为依赖项 在pom.xml上添加以下内容 <groupId>com.xinterium.jspi</groupId> <artifactId>jspi-...
It covers all the technologies needed to program web applications in Java using Servlets 2.3, JSP 1.2, EJB 2.0 and client-side programming with JavaScript. These technologies are explained in the ...