如何使用JavaScript调用Linux命令 [英] How to invoke Linux command with JavaScript

查看:234
本文介绍了如何使用JavaScript调用Linux命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是JavaScript的新手,现在我想用JavaScript运行Linux应用程序并在网页中显示结果。这一切都发生在没有服务器的客户端。但是对于安全问题或其他问题,JavaScript就没有这样的接口。我知道在Windows中,它可以通过activeX实现,但我怎么能在Linux中实现这一点?

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?

我只想让js +浏览器等于客户端应用程序而不是复杂的GUI设计。所以没有服务器。有没有简单的方法来实现它?

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?

推荐答案

也许 Node-webkit 就是你想要的。

它允许您轻松地在javascript中创建桌面应用程序并访问低级内容,这样您就可以运行命令,而无需使用http服务器。

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.

这篇关于如何使用JavaScript调用Linux命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆