如何配置IE来制作“wscript.shell”工作 [英] How to config IE to make "wscript.shell" work
本文介绍了如何配置IE来制作“wscript.shell”工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一些过去常用的代码。但是今天我再试一次。我一直得到[对象错误]。
I have some code that used to work. But I today when I try it again. I kept got "[object error]".
我认为这是IE安全配置的问题。但我可以找到如何配置IE以使其工作。
I thought it's the problem of IE safety configure. But I can find how to config IE to make it work.
function Run() {
try {
var objShell = new ActiveXObject("wscript.shell");
objShell.Run("calc");
} catch(e) {
alert(e);
}
}
推荐答案
你必须启用ActiveX:
You must enable ActiveX:
- 点击工具
- 选择 Internet选项...
- 选择安全选项卡。
- 在Web内容区域中选择Internet。
- 然后,点击自定义级别...
- 浏览所有ActiveX设置,选择提示或启用
- Click on Tools
- Select Internet Options...
- Select Security tab.
- Select Internet in Web content zone.
- Then, click on Custom Level...
- Go through all the ActiveX setting there, select Prompt or Enable
这篇关于如何配置IE来制作“wscript.shell”工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文