I am supplying a list of objects to my django template. I have a conditions where i am accessing one of the field of object in template which is a json field containing u'
characters like {u'option': False, u'name': u'test string'}
We usually use json.dumps for this in python to convert this to {option: False, name: test string}
, which is proper json that i want to have as i need to access such string in my javascript.
Is there a simple way to do this in javascript? I would like to avoid using regex to strip out u' and '
and replace with
Sorry if this was very basic. Don't know much about javascript.
Or is there a way to just encode my object fields to_json somehow from python?