59
rated 0 times
[
60]
[
1]
/ answers: 1 / hits: 53582
/ 12 Years ago, wed, april 25, 2012, 12:00:00
What is the recommended way to create dynamic URLs in Javascript files when using flask? In the jinja2 templates and within the python views url_for
is used, what is the recommended way to do this in .js
files? Since they are not interpreted by the template engine.
What basically want to do is:
// in comments.js
$.post(url_for('comment.comment_reply'));
Which is not possible.
But naturally, I can execute that in a template:
<script>
$.post(url_for('comment.comment_reply'));
</script>
More From » python