Execute a python script on button click

后端 未结 2 407
忘掉有多难
忘掉有多难 2020-12-02 19:29

I have an HTML page with one button, and I need to execute a python script when we click on the button and return to the same HTML page with the result.

So I need do

2条回答
  •  一个人的身影
    2020-12-02 19:55

    You can use Ajax, which is easier with jQuery

    $.ajax({
       url: "/path/to/your/script",
       success: function(response) {
         // here you do whatever you want with the response variable
       }
    });
    

    and you should read the jQuery.ajax page since it has too many options.

提交回复
热议问题