Answers for "django pass list to javascript"

0

django pass list to javascript

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}}")
Posted by: Guest on September-04-2021

Code answers related to "django pass list to javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language