I\'ve tried to parse the following json response with both the JQuery getJSON and ajax:
[{\"iId\":\"1\",\"heading\":\"Management Services\",\"body\":\"
It is maybe because your output buffer is not empty, so AJAX receive bytes which don't belong to the JSON.
Try clean buffer with ob_clean()
on server side just before output your json with echo
or die()
. And you don't need to specify contentType
, I think for you default value will work correctly.
I had the same problem and it solve it.
Hope to help you.