Hi Everyone,
I want to execute a script by clicking a HTML button that contains some shell commands. So far I 've done this,
```
<input type="button" id='script' name="scriptbutton" value=" Run Script " onclick="goPython()">
<script src="
http://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<script>
function goPython(){
$.ajax({
type: 'GET',
url: 'script.py',
dataType:'script',
success: function(data){
alert(data);
console.log('success',data);
}
});
</script>
```
But this is just showing me the contents of the file rather than executing it. Can you guys tell me how can I execute this script by clicking the button.
I googled, the answer I got was to send a $http request to the script.py and set up a listener on my python script. But I'm not sure how to achieve that.