I am generating a data expressed as a Python dictionary which is dumped using simplejson via url which is in this format.
{"2": "London", "3": "Tokyo", "4": "Sydney"}
I am using $.get and storing into a variable data.
However eval(data) does not generate an Associative Array. Actually throws up an error. What is the problem? What is the solution?
Edit: I have shared the code
http://dpaste.com/570901/
evalis slow, inefficient and hard to debug. Don’t use it.Have your script output an
application/jsoncontent-type header, and jQuery will convert JSON to a JS object automatically.