在web頁面中調用本地應用程序

1 <script type="text/javascript"> 2 $(function () { 3 $(".navbox-tiles a").click(function () { 4 Run("C:\\Program Files\\Microsoft Office\\root\\Office16\\OUTLOOK.EXE"); 5 }); 6 }); 7 8 function Run(strPath) { 9 try { 10 var objShell = new ActiveXObject("wscript.shell"); 11 objShell.Exec(strPath); 12 objShell = null; 13 } 14 catch (e) { 15 alert(e); 16 } 17 } 18 </script>