json: python 2.5: error in browser

Vineet Deodhar d_vineet at yahoo.com
Sat Sep 3 10:58:44 CEST 2011


> Any idea on converting list to json in python 2.5?
http://pypi.python.org/pypi/simplejson/
Cheers,
Chris
=============
Now I built json from simplejson.
While trying to render the same in browser, nothing is displayed.
Opera Dragonfly shows this error:--
 
Uncaught exception: SyntaxError: JSON.parse: Unable to parse value: A,B,C
Error thrown at line 3, column 0 in http://127.0.0.1:8000/mywheels/test/cat:
    var ctg = JSON.parse(["A", "B", "C"]);
~~~~~~~~~~~~~~~~
I validated this json --  ["A", "B", "C"]   in jsonlint.com
It is valid json.
 
Why the method "JSON.parse" is unable to parse JSON?
 
--Vineet
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110903/e6870249/attachment.html>


More information about the Python-list mailing list