现在的系统是B/S架构,想要客户端自动下载服务器端的控件并注册,然后调用控件的方法,我先假设控件已下载并注册,试了下简单的控件方法调用。
<%@ page contentType="text/html;charset=UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01Transitional//EN">
<%
String path = request.getContextPath();
%>
<html>
<head>
<%@includefile="/screen/common_environment/header.jsp"%>
</head>
<body>
<objectclassid="clsid:56ED538E-58F4-44E9-8EF8-FC2DB84709EE"codeBase="/exe/ocx/FilePro.ocx#version=1,0,0,1" id="FilePro"height=100 width=100>
</object>
<script type="text/javascript"language="javascript">
//functionloadocx(){
alert("开始调用控件方法!");
try{
varobj=document.getElementByIdx_x("FilePro");
if(obj.readyState==4){
alert("加载成功!");
varbackvalue=FilePro.MakeDir("e://test");
alert(backvalue);
}else{
alert("加载失败!");
}
}catch(ex){
log.info("ex.description");
}
alert("调用成功!!");
//}
</script>
</body>
</html>