javascript - Convert string to be a valid to use in json -


i have little question json string. have this:

[     {         "index": 0,         "name": "block         "             '         "     } ] 

but needs valid json string new lines , these quotes. there somthing can in javascript replace string make json string

it javascript:

json.parse(jsonstring); 

look more:

https://developer.mozilla.org/en/docs/web/javascript/reference/global_objects/json/parse


Comments