I'm trying to send data results from django to javascript in JSON through an AJAX call. In django I have the below variable
results = {key1:[1,2,3],
key2:[[name1,lat1,lng1],[name2,lat2,lng2],[name3,lat3,lng3]]}
I can then successfully return a json dump of results
I have verified that the data being captured by my javascript ajaxSuccess function is exactly results
I would like the output to be as follows:
var1 = [1,2,3]
var2 = [name1, lat1, lng1]
var3 = [name2, lat2, lng2]
var4 = [name3, lat3, lng3]
What is the best way to parse the results in javascript and should I reformat it some other way in django first?