开发者

How to launch an application using javascript?

I want to launch an application eg. notepad or MSword on click of a button using javascript function. I have tried ActiveXObject meant for IE.

function runApp()
{
    var shell = new ActiveXObject("WScript.shel开发者_JAVA百科l");
    shell.run("notepad.exe", 1, True);
}

I need a solution which supports Firefox. Please suggest.

Thanks in advance.


You cannot use ActiveX commands from Firefox. See more here: http://support.mozilla.com/en-US/kb/activex And you cannot launch an application using Javascript. Maybe with a Java Applet, or something.


You can't - browser security prohibits it from linking with the file-system or other applications on a users machine.

http://support.mozilla.com/en-US/kb/ActiveX


Needs a NPAPI plugin. Check This out.


The best thing I can think off is serving a file which would be linked to open in the application concerned. So if you serve a .doc file the user would generally open it in Word.. assuming Word is installed and configured that way.. there is no way to guarantee this.

But you can't then interact with the application directly from the browser - as others have pointed out this would be a malware nightmare if possible.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜