//浏览器版本
function getOs() {
var OsObject = "";
if (navigator.userAgent.indexOf("MSIE") > 0) {
return "1";
}
if (isFirefox = navigator.userAgent.indexOf("Firefox") > 0) {
return "2";
}
if (isSafari = navigator.userAgent.indexOf("Safari") > 0) {
return "3";
}
if (isCamino = navigator.userAgent.indexOf("Camino") > 0) {
return "4";
}
if (isMozilla = navigator.userAgent.indexOf("Gecko/") > 0) {
return "5";
}
}
//加载Ocx
//OcxDocID:插件ID,ParentDocID:dom元素ID,存放插件的dom元素,width:宽度,height:高度
//加载
function LoadOCX(OcxDocID, ParentDocID, width, height) {
var version = getOs();
var ocxMsg = "";
//*********************************///
//根据插件不同,换成对应插件的clsid,和插件的下载路径和版本号
var clsid="B27BBEFD-E60D-4A46-AEB3-E292FDA532B3";
var ocxPath="/Content/OCX/MeetAvPlugin.cab#version=1,0,0,61";
//*********************************///
if (version == "1") {
//IE浏览器
ocxMsg = " <object id=\"" + OcxDocID + "\" type=\"application/x-itst-activex\" classid=\"clsid:"+clsid+"\"";
ocxMsg += " codebase=\""+ocxPath+"\" ";
}
else {
//其他浏览器
ocxMsg = " <object id=\"" + OcxDocID + "\" type=\"application/x-itst-activex\" clsid=\""+clsid+"\"";
ocxMsg += " progid=\""+ocxPath+"\" ";
}
ocxMsg += " class=\"tab-mt\" style=\"";
if (width) {
ocxMsg += "width: " + width + "px;";
}
if (height) {
ocxMsg += "height: " + height + "px;";
}
ocxMsg += "\"></object>";
//加载OCX
var ParentDoc = document.getElementById(ParentDocID);
if (ParentDoc) {
ParentDoc.innerHTML += ocxMsg;
}
}