Ahoy!
I am using a WCF service to handle ajax calls from a web server on a seperate domain (therefore employing JSONP). My call looks like this:
$.ajax({
dataType: 'jsonp',
type: 'GET',
url: 'http://localhost/s.svc/login?callback=?&l=en&e=foo&p=bar',
success: function (serverData) {
// [...]
},
error: function (jqXHR, textStatus, errorThrown) {
// [...]
}
});
The response I get from the server looks like this:
?({"DataIsValid":true,"ErrorOccurred":false,"EmailAddressValidationMessage":"","PasswordValidationMessage":""});
And jQuery subsequently throws a parsererror when reading it.
The response above looks like valid JSON and, per the documentation, I think "?callback=?" is appropriate for $.ajax calls using JSONP.
Thanks in advance for pointing out what I am obviously missing :-)