适用于Chrome或FF的ActiveXObject不适用于IE

时间:2016-07-29 09:12:25

标签: html

而不是ActiveX对象我必须使用Chrome或FF。 以下代码无法在Chrome和FF上运行。 我收到以下错误 “未捕获的ReferenceError:未定义ActiveXObject”。

<!DOCTYPE html>
<html>
<head>
    <title>Application Executer</title>
    <HTA:APPLICATION ID="oMyApp" 
	    APPLICATIONNAME="Application Executer" 
	    BORDER="no"
	    CAPTION="no"
	    SHOWINTASKBAR="yes"
	    SINGLEINSTANCE="yes"
	    SYSMENU="yes"
	    SCROLL="no"
	    WINDOWSTATE="normal">



    <script type="text/javascript" language="javascript">
        function RunFile() {
		WshShell = new ActiveXObject("WScript.Shell");
		WshShell.Run("c:/vlc-2.2.4-win64.exe", 1, false);
        }
    </script>
</head>
<body>
	<input type="button" value="Run Notepad" onclick="RunFile();"/>
</body>
</html>

1 个答案:

答案 0 :(得分:1)

没有跨浏览器的方式来触发从HTML文档在用户系统上执行应用程序。

相关问题