M
M
Milinkton2022-02-12 12:51:17
JavaScript
Milinkton, 2022-02-12 12:51:17

How to set up two way communication between flask and JS?

I can't find a solution to my problem anywhere. There is a simple form in HTML. JS handles it. At one stage of validation, you need to pass the value from the form to Python, process it there, and return the value back to JS for further validation in JS. Be sure to do it through FLASK.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Yakushenko, 2022-02-12
@kshnkvn

1. Write an API in Flask. There are a lot of articles on the Internet, for example this one .
2. From your JS script, you access the API, for example, using fetch .
3. Satisfied with the result.

V
Vladimir Kuts, 2022-02-12
@fox_12

I can't find a solution to my problem anywhere

Enter three keywords in Google - flask api ajax - and rake out examples
Including in the official documentation

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question