解决IE需要激活 ActiveX 控件和生成控件调用代码
2006-12-25 22:20
579 查看
//AXObject.js代码 function AXObject(id,classid,tagName){ this.tagName = (typeof tagName == 'string')?tagName:"object"; this.params = new Object(); this.variables = new Object(); this.setVariable("id",id); this.setVariable("name",id); this.setVariable("classid",classid); } AXObject.prototype.setParam = function(key,value){ this.params[key] = value; } AXObject.prototype.getParam = function(key){ return this.params[key]; } AXObject.prototype.getParams = function(){ return this.params; } AXObject.prototype.setVariable = function(key,value){ this.variables[key] = value; } AXObject.prototype.getVariable = function(key){ return this.variables[key]; } AXObject.prototype.getVariables = function(key){ return this.variables; } AXObject.prototype.getHtml = function(){ var con = '<'+this.tagName+' '; var variables = this.getVariables(); for(var key in variables){ con += key + '="' + variables[key] + '" '; } con += ' >'; var params = this.getParams(); for(var key in params){ con += '<param name="'+ key +'" value="'+ params[key] +'" />'; } con += '</'+this.tagName+'>'; return con; } AXObject.prototype.write = function(elementId){ if(typeof elementId == 'undefined'){ document.write(this.getHtml()); }else{ var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId; n.innerHTML = this.getHtml(); } } |
//调用实例; <script language="javascript"> var axo = new AXObject("mediaPlayerObject","clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6"); axo.setVariable("width","400"); axo.setVariable("height","300"); axo.setParam("URL","http://bbmedia.qq.com/media/game/2006/06/20060626contra.wmv"); axo.setParam("rate","1"); axo.setParam("balance","0"); axo.setParam("currentPosition","0"); axo.setParam("playCount","1"); axo.setParam("autoStart","0"); axo.setParam("currentMarker","0"); axo.setParam("invokeURLs","-1"); axo.setParam("volume","0"); axo.setParam("mute","0"); axo.setParam("uiMode","full"); axo.setParam("stretchToFit","-1"); axo.setParam("windowlessVideo","0"); axo.setParam("enabled","-1"); axo.setParam("enableContextMenu","0"); axo.setParam("fullScreen","0"); axo.setParam("enableErrorDialogs","0"); axo.write(); </script> |
相关文章推荐
- 将Capicom调用代码封装到ActiveX——解决javascript调Capicom读取数字证书信息时,IE弹出安全提示的问题
- 终于解决了IE控件需要激活的问题
- [转]IE"单击以激活控件"网站代码解决法
- IE"单击以激活控件"网站代码解决法
- IE"单击以激活控件"网站代码解决法
- IE"单击以激活控件"网站代码解决法
- [转]IE"单击以激活控件"网站代码解决法
- IE"单击以激活控件"网站代码解决法
- IE"单击以激活控件"网站代码解决法 [转]
- IE"单击以激活控件"网站代码解决法
- [转]IE"单击以激活控件"网站代码解决法
- 将Capicom调用代码封装到ActiveX——解决javascript调Capicom读取数字证书信息时,IE弹出安全提示的问题
- 将Capicom调用代码封装到ActiveX——解决javascript调Capicom读取数字证书信息时,IE弹出安全提示的问题
- vs2010开发activex(MFC)控件/ie插件(三),js调用ocx控件的接口函数
- 解决“单击以激活并使用此控件”的办法(解决flash)(代码全部贴出)
- IE下自动激活 ActiveX 控件
- 关于OCX控件在ie下调用不了接口的解决方法
- jquery出现“为了有利于保护安全性,IE已限制此网页运行可以访问计算机的脚本或 ActiveX 控件。请单击这里获取选项...”的解决办法
- 类中调用界面ActiveX控件报错当前线程不在单线程单元中因此无法实例化 ActiveX 控件的解决办法
- vs2010开发activex(MFC)控件/ie插件(三),js调用ocx控件的接口函数