I'm unable to parse a simple JSON-Object returned by PHP after an AJAX-
XMLHttpRequest(). Here is the bizarreness in a nutshell (using a simple json for a test):
On page loads, if PHP sends:
my little JSON2HTML function recognizes typeof object and parses the json without complaint.
However, if PHP returns the exact same JSON string (from same PHP variable) via
typeof object and the function fails.
I have set the php response header to
"Content-Type:application/json;charset=utf-8", stripped all non-ascii characters from the response string and have manipulated the json object in every way imaginable and always get the same result. I've also tried to
JSON.parse the ajax string and get an "unexpected token" error.
Anyone know what could possibly be happening here?