How to pass Jinja2 variable to javascript

Viewed 41
  1. How to pass Jinja format variable to javascript Ex: {{a.Value}} How to pass the a.value to javascript ? Getting this variable from py file.
1 Answers

You just pass through render_template as normal:

var = 'data’
return render_template('index.html', var=var)
Related