2

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?

jww
  • 97,681
  • 90
  • 411
  • 885
user1411856
  • 21
  • 1
  • 3

3 Answers3

1

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.

ack__
  • 913
  • 1
  • 14
  • 39
-1

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.

Jivings
  • 22,834
  • 6
  • 60
  • 101
  • Not entirely true. JavaScript interpreter in a Web browser cannot access client system, but no one prevents you from running JavaScript interpreter in other environment, or even stand-alone. Look at node.js, or gnome-shell for example. – el.pescado - нет войне Oct 28 '13 at 21:02
-1

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.

Community
  • 1
  • 1
Adam Fili
  • 463
  • 2
  • 9