html - Using javascript to call external programs (Eg: a C program) - Stack Overflow

I have a web page. I would like to include javascript in the webpage such that on a particular action,

I have a web page. I would like to include javascript in the webpage such that on a particular action, the javascript will call an external program, like a C applet program, on my machine. Is it possible to call an external C program using Javascript either directly or through mand line?

I have a web page. I would like to include javascript in the webpage such that on a particular action, the javascript will call an external program, like a C applet program, on my machine. Is it possible to call an external C program using Javascript either directly or through mand line?

Share Improve this question asked Nov 13, 2011 at 3:15 ssnssn 2,7414 gold badges28 silver badges32 bronze badges 1
  • on internet explorer you can use ActiveX object, but the user will be warned about the danger. – Victor Commented Nov 13, 2011 at 5:05
Add a ment  | 

4 Answers 4

Reset to default 3

No. It's a browser security issue. Client-side JavaScript cannot acces things outside the browser.

You can't do it for other users as maxedison explained.

However you can install something called a network.protocol-handler in the browser, javascript can trigger that, and that can run whatever you want.

For example in firefox create the key network.protocol-handler.app.foo and set the value to the executable you want to run. If you go to foo://blah then the executable will run with the value blah as a parameter.

Of course you can't do this to someone else's machine, but you can to your own.

See Google's Native Client SDK : http://code.google./chrome/nativeclient/

use window.external.c_function ... but you need to see how to pile you C code... we are doing something like this in one of our project ... and it is working like charm ...

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744573463a4581594.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信