开发者

Executing shell commands on linux using javascript

I have a scenario in my webapp where i wan开发者_开发百科t to execute some shell command on the client , so is their any way i can achieve this using javascript. Their is a method "exec" in php but i think that will execute command at the server end.

Thanks in Advance, Vinay


No, JavaScript does not have access to the client machine, and certainly cannot execute shell commands. While this may be unfortunate for your genuine requirement, this is an important limitation for obvious security reasons.


No, javascript cannot execute a command on the client-side. You could probably use an activeX control or a custom extension for Firefox... but its complicated:)


JavaScript can not do that but you can call server-side script, PHP for example, using Ajax request and pass command to it as a parameter, PHP script would retrieve the command and execute with exec() function.

P.S. bad practice...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜