为什么这段javascript 在jsp中不能执行啊,在html文件中是却是好好的呀?
<html>
<head>
<title>test</title>
<script language="javascript">
function runExe(sPath)
{
var oShell = new ActiveXObject("WScript.Shell");
try
{
oShell.Run(sPath);
}
catch(e)
{
document.write("Error Exec ");
}
}
</script>
</head>
<body>
<a href="javascript:" onclick="runExe('c:\\test.txt');">open</a>
<a href="javascript:" onclick="runExe('C:\\VLC\\vlc.exe'+' '+'http://192.168.0.135:1234');">open vlc</a>
<a href="javascript:" onclick="runExe('c:\\setup.exe');">open setup</a> <input type="button" value="记事本" onClick="runExe('c:\\test.txt');"/>
</body>
</html>
<html>
<head>
<title>test</title>
<script language="javascript">
function runExe(sPath)
{
var oShell = new ActiveXObject("WScript.Shell");
try
{
oShell.Run(sPath);
}
catch(e)
{
document.write("Error Exec ");
}
}
</script>
</head>
<body>
<a href="javascript:" onclick="runExe('c:\\test.txt');">open</a>
<a href="javascript:" onclick="runExe('C:\\VLC\\vlc.exe'+' '+'http://192.168.0.135:1234');">open vlc</a>
<a href="javascript:" onclick="runExe('c:\\setup.exe');">open setup</a> <input type="button" value="记事本" onClick="runExe('c:\\test.txt');"/>
</body>
</html>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货