Linking buttons to external scripts in html | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Linking buttons to external scripts in html

can you link an html button to an external script. for instance executing a disable wifi adapter script in terminal on a linux OS(script premade and ready to execute once called on) and if so, can it only be a click button or can i make a toggle button(ie on and off where on executes enable adapter and off executes a seperate, maybe a javascript with an if then statement?)

9th Oct 2018, 8:05 PM
Charles Beason
Charles Beason - avatar
3 Answers
+ 1
javascript cant access the file system in the host for security reasons. Some browsers support vbscript and that would work but not on linux.
12th Oct 2018, 10:41 PM
Arthur Tripp
Arthur Tripp - avatar
+ 1
i did some googling. https://github.com/nwjs/nw.js/blob/nw34/README def check this i think it might work for you.
16th Oct 2018, 11:36 AM
Arthur Tripp
Arthur Tripp - avatar
0
ok what about other languages? my goal is to build an html interface page similar to POS systems. then included in that same folder add scripting documents that can be executed within terminal to perform very specific functions like enable and disable wifi adapter or BT. as long as the scripting docs are located in the source folder can that be done? if so would i need to include an 'execute in root/sudo' styled doc as well to run first each time? and just use java or other source code to handle the logical execution order and user input? im also considering using the button to launch a java based user input(similar to the 'select which boot options) to execute specific series of command like disable wifi
15th Oct 2018, 3:24 PM
Charles Beason
Charles Beason - avatar