I'm currently working on a local web application and I want to be able to trigger an external application using a button click. I came across this code that works perfectly in an .html file with Internet Explorer, but when I try to implement it within a show.html.erb file, it throws an error message instead.
<script language="javascript">
function LaunchApp(appPath)
{
try
{
WSH = new ActiveXObject("WScript.Shell");
WSH.run(appPath);
}
catch (ex)
{
errMsg = "An error occured while launching the application.\n\n";
alert(errMsg);
}
window.open('', '_self', '');
}
</script>
<button onclick="LaunchApp('C:\\windows\\system32\\notepad.exe')">Click me</button>
Is there a way to successfully launch the external application from within this setup?