js动态创建activex, 动态创建applet, 动态创建word, 动态创建wps

来源:互联网 发布:c语言中memset函数 编辑:程序博客网 时间:2024/06/05 06:26
//debugger;try {if (this.WordApp == null) {this.WordApp = new ActiveXObject("Word.Application");try {this.WordApp.Application.Caption = key;} catch (e) {}this.WordApp.Application.Visible = true;this.WordApp.DisplayAlerts = false;wpsoroffice = "office";} else if (!this.WordApp.Application)this.WordApp = null;} catch (e) {this.WordApp = null;}if (this.WordApp == null) {this.WordApp = new ActiveXObject("WPS.Application");try {this.WordApp.Application.Caption = key;} catch (e) {}this.WordApp.Application.Visible = true;this.WordApp.DisplayAlerts = false;wpsoroffice = "wps";}

/** * 动态添加activex否则启动。 * */function CreateYFToolSocket_rfid(){var rfid_ocx = document.getElementById("rfid_ocx");if(!rfid_ocx){var divApplet = document.createElement("div");divApplet.innerHTML = '<OBJECT id="rfid_ocx" classid="clsid:1814628D-13BB-4794-A986-78212924E5F0" codebase="yfrfidtoolProj1.ocx#version=3,0,0,0"></OBJECT>';if(document.body)document.body.appendChild(divApplet);elsedocument.appendChild(divApplet);rfid_ocx = document.getElementById("rfid_ocx");}if(rfid_ocx){}else{return;}return rfid_ocx;}


function writeObject(){var obj = document.getElementById("mydelphi");if(!obj){var divobj = document.createElement("div");divobj.innerHTML = '<OBJECT id="mydelphi" classid="clsid:84864ABE-E805-436C-9683-F11C1BB72FC3" codebase="'+mainpath+'ActiveFormProj1.ocx#version=2,0,0,0" width=0 height=0 align=center hspace=0 vspace=0></OBJECT>';if(document.body)document.body.appendChild(divobj);elsedocument.appendChild(divobj);obj = document.getElementById("aaa");}return obj;}


var applet = document.getElementById("socketapplet");if(!applet){var divApplet = document.createElement("div");divApplet.innerHTML = '<applet code="Applet" name="socketapplet"'+'id="socketapplet" archive="'+mainpath+'appletweb.jar" width=0 height=0>';+'<param name=hostAddr value="'+mainpath+'">' +'</applet>';if(document.body)document.body.appendChild(divApplet);elsedocument.appendChild(divApplet);applet = document.getElementById("socketapplet");}return applet;



原创粉丝点击