I am new in JavaScript, and now I want to run a Linux application in JavaScript and show the result in a web page. It all happens in client without a server. But for security issues or something else, JavaScript as no such interfaces. I know in Windows, it could be achieved with activeX, but how could I achieve this in Linux?
I just wanna make js+browser equal to a client application without the complex GUI design. So there is no server. Any easy way to accomplish it?
-
possible duplicate of javascript (spidermonkey) how does one run a linux command from js shell?Tomasz Nurkiewicz– Tomasz Nurkiewicz2012年05月24日 07:21:19 +00:00Commented May 24, 2012 at 7:21
-
without a server? How are you gonna serve the javascript to your users then?Andreas Wong– Andreas Wong2012年05月24日 07:21:30 +00:00Commented May 24, 2012 at 7:21
-
stackoverflow.com/questions/6216024/…Ja͢ck– Ja͢ck2012年05月24日 07:22:17 +00:00Commented May 24, 2012 at 7:22
-
You want to run that command on client machine, am I right?el.pescado - нет войне– el.pescado - нет войне2013年10月28日 21:00:00 +00:00Commented Oct 28, 2013 at 21:00
3 Answers 3
Maybe Node-webkit is what you want.
It allows you to easily create a desktop application in javascript and access "low-level" stuff so you can run commands, without the need of an http server.
1 Comment
Can't be done.
JavaScript cannot interact with the users system in any way.
The only thing you can do is send a request to a server, which executes the command and sends the response back.
1 Comment
With javascript alone can't be done. But you have at least two option to do this using javascript plus other technologies.
The first one is what Jivings sent, using Jquery to sent a post request to a scripting language at the server side.
The second way is to install Node.js. This platform runs on javascript engine, and has all the features you need from the language. After installing it just see this post that explains how to execute a command.