Here is the JSON returned from my Server.
"[{"description":"A user","name":"test","type":"user"}]"
I want to remove the outer double quates. Which means I want the JSON as
[{"description":"A user","name":"test","type":"user"}]
How can I do this? Please help.
As the response from the server is not valid JSON you have to request it as text, fix it, and parse it as JSON. Use
dataType: 'text'in your options in the ajax call.Use the
substrmethod to cut of the first and last character:Then you can parse the JSON: