1

Sorry beginner question.

I would like to execute a terminal command on my local host (Command would be to start a bash script ./test.sh ) upon clicking a button on the HTML webpage.

How do I program this in Javascript to get server side access and execute the script ?

Thanks

2 Answers2

0

Client-side JavaScript can't do this. You will need to write server-side JavaScript (NodeJS) or use another server-side technology (like Java) that can call arbitrary commands. See here for an example with NodeJS.

Miles Grimes
  • 432
  • 2
  • 16
0

Normally this is not possible in web browser without using server-side approach. You can use os.runCommand() in Neutralinojs easily to do above task

Shalitha Suranga
  • 1,138
  • 8
  • 24