Flask向模板中JS传值简便方式

 

后台传值:

return render_template('statistics/numberofuserlogin/login_number.html', result_json = json.dumps(result))

 

模板中JS取值:

js_object = eval('{{result_json|safe }}')

 

 

参考链接:

https://www.cnblogs.com/lazyboy1/p/5015111.html  

posted @ 2019-01-04 16:54  WESWES  阅读(4673)  评论(0编辑  收藏  举报