While trying to use:
$.ajax({
type: "POST",
url: surl,
data: {funcToCall: "getHello",val:"Luke"},
dataType: "jsonp",
jsonp : "callback",
jsonpCallback: "getHelloResponse"
}).success(function(data){
alert(JSON.stringify(data));
}).
error( function (data){
alert(JSON.stringify(data));
});
I receive:
{"readyState":4,"status":200,"statusText":"success"}
But when leaving out the type which defaults type to "GET", it works fine!
The target php page was edited to handle POST and GET.
EDIT:
So the actual question is: why is the ajax post not returning the expected result of "Hello Luke!"?