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. 

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/angular/10940548-b268-4ef8-84e5-130124dd8b35%40googlegroups.com.

Reply via email to