0

I understand that there is already a similar query here.

My query is different from the above; I have a function that is already defined in my Python script (a Flask app). I want to be able to call this function in my HTML script WITHOUT going to another webpage/URL (meaning that there is no need to create an @app.route in the Python script).

I want it to be such that when the user clicks on the link, the function is called (it's a visual plotting function), and on the same page/URL the plot is created and displayed.

How can this be done in general? Thank you.

user12575866
  • 107
  • 1
  • 4

1 Answers1

1

When you want to modify a page after it has been loaded in general you use javascript.

And if you need to query new datas or to process datas on the backend side as it is the case here, you'll use Ajax which allows you to query your backend without reloading your page.

Maxime
  • 818
  • 6
  • 24