I\'m having this headache now, since I\'ve been having this problem the whole day and, still, can\'t fix it. I\'ve looked on Google and StackOverflow for hours, tried many m
Just change your response to text and then parse the text as JSON, example:
var json = JSON.parse(data);
because you are doing cross domain calls you need to use JSONP. The PHP server must form a response that looks like this: callback( jsonSyntax);
Try to change the JQuery URL from :
http://www.example.com/ws/webservice.php/methodName
To:
http://www.example.com/ws/webservice.php?method=methodName
And then try to read it from the $_GET['method'] from PHP, I think this should be your problem
Change
contentType: "application/json utf-8",
to
contentType: "application/json; charset=utf-8",
The malformation of your contentType
header is causing your server to incorrectly interpret the content of your POST
request.