I would like to pass a Jinja2 variable into a .js file. Then call the file from my page. Is that possible.
example:
test.js file
alert('{{myFlaskVar}}')
page.html
<script src="/static/scripts/test.js"></script> //but pass the myFlaskVar
I would like to pass a Jinja2 variable into a .js file. Then call the file from my page. Is that possible.
example:
test.js file
alert('{{myFlaskVar}}')
page.html
<script src="/static/scripts/test.js"></script> //but pass the myFlaskVar