📌  相关文章
📜  django 将列表传递给 javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:56.987000             🧑  作者: Mango

代码示例1
import json

mylistraw = [10,22,33,45]

mylist = json.dumps(mylistraw)

context = {''mylistjson': mylist}

now you can use your object in javascript.

var mylist = JSON.parse("{{mylistjson}}")