简体   繁体   中英

Executing shell commands on linux using javascript

I have a scenario in my webapp where i want 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.

PS bad practice...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM