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

//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);
		else
			document.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);
		else
			document.appendChild(divApplet);
		applet = document.getElementById("socketapplet");
	}	
	return applet;



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值