How to invoke Linux command with JavaScript

后端 未结 3 753
盖世英雄少女心
盖世英雄少女心 2021-01-22 05:41

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 is

相关标签:
3条回答
  • 2021-01-22 06:13

    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.

    0 讨论(0)
  • 2021-01-22 06:18

    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.

    0 讨论(0)
  • 2021-01-22 06:30

    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.

    0 讨论(0)
提交回复
热议问题