I know how to pass data with a jinja template from python into javascript, but I want to pass a javascript variable into python. I'd like to do it without reloading the page. Is that possible?
Passing a JavaScript Variable to a Python variable in Flask First, we will be forming our HTML page, with a basic input area and JavaScript function to pass the value along. We have an onclick() function that is calling our senduserinfo() JavaScript function.
Flask is an open source tool with 45.2K GitHub stars and 12.7K GitHub forks. Here's a link to Flask's open source repository on GitHub. Airbnb, Instagram, and reddit are some of the popular companies that use JavaScript, whereas Flask is used by Netflix, reddit, and Lyft.
Yes, like monkut said--I believe you want to use JSON and Javascript/jQuery.
This will let allow communication from client to server and back again.
The most applicable example I found was in the Flask snippets/patterns: http://flask.pocoo.org/docs/patterns/jquery/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With