Answer the question
In order to leave comments, you need to log in
Why doesn't Jquery parse JSON array?
Good day. Please write what could be causing the problem.
I am on 127.0.0.1. Php returns encoded json array. I get the array through $.getJSON and do the parsing, everything works until the Content-type: application / json is set in the response header. After that, jQuery stops seeing the response from the server as an object, it processes it as a string.
If sent with the usual Content-type:text/html $.each() header, everything works fine.
And I also noticed: When the title is set as json, then it is written to the console as a string, and when it is text/html, then the response is written to the console as an object.
Of course, the problem is not critical, but I would like json to be given with the application/json header
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question