这里我尝试用ActiveXObject调用系统计算器。在IE中,它对我来说很好,但在Firefox中,它不会出现。我得到了一个未定义的错误。如何在Firefox中解决这个问题?
try{
if(gBrowser == 'IE'){
var shell = new ActiveXObject("WScript.Shell");
shell.Run("calc");
}
else{
var shell = new ActiveXObject("WScript.Shell");
shell.Run("calc",1,true);
}
}
catch(e){
if(gBrowser == 'IE'){
alert(e.description);
}
else{
alert(e.description);
}
}
发布于 2013-04-18 02:42:34
‘t.ActiveX是微软唯一支持的专有技术,IE支持它,火狐不支持ActiveXObject
,它也不能访问shell对象。
您可以在FF中创建COM组件,但在这种情况下,它需要一个插件和一些明确的effort.Probably,而不是解决方案。
火狐不支持ActiveX技术有多种原因。
https://stackoverflow.com/questions/16080744
复制相似问题