【发布时间】:2020-07-10 06:05:05
【问题描述】:
我有一个使用 jinja 的条件,我想在满足该条件时运行一段 js 代码。
这是我的代码:
M.toast({html: 'I am a toast!', classes: 'rounded'})
{% if condition %}
run js right here
{% endfor %}
编辑:顺便说一句,我正在使用 materializecss toasts。链接:https://materializecss.com/toasts.html
【问题讨论】:
-
我的是 if 条件。我可以把 html 放在我的 if 条件中,所以我可以把 js.我想知道如何执行 js 命令,没有 html 中的按钮。我想这样做的原因是因为我正在使用 jinja 条件。
标签: javascript html jinja2