JSON | Django passing python list
Posted
by MMRUser
on Stack Overflow
See other posts from Stack Overflow
or by MMRUser
Published on 2010-03-12T19:29:30Z
Indexed on
2010/03/12
19:37 UTC
Read the original article
Hit count: 147
Hi,
I'm trying to send a Python list in to client side (encoded as JSON), this is the code snippet which I have written:
array_to_js = [vld_id, vld_error, False]
array_to_js[2] = True
jsonValidateReturn = simplejson.dumps(array_to_js)
return HttpResponse(jsonValidateReturn, mimetype='application/json')
So my question is how to access it form client side, can I access it like this:
jsonValidateReturn[0]
or how I assign a name to the returned JSON array in order to access it?
© Stack Overflow or respective owner