+ 8
Do I have to use JSON. parse () when I am accessing data from an api using ajax(jQuery)?
4 Respuestas
+ 4
I haven't used it here and it's still working. Toni Isotalo can you tell me why is it so?
https://code.sololearn.com/WQi9V4ROW7L2/?ref=app
+ 4
Apparently it depends on the content type of the api. Most API content types are application/json you don't need to parse it. But if there's no content type header set it's a string.
+ 1
JSON.stringify usually works well (depending on the data). here is an example.
https://code.sololearn.com/WA6VU5LNNvvt/?ref=app
0
you can parse the json in backend and return the data in succes: inside ajax call and there you can play with it. i think this is what you need?