When I try to call ajax using jquery 1.5/1.7 it gives an error "No transport" (the same jquery works fine with 1.3). To avoid this I tried using "datatype" parameter with the $.ajax function as "JSONP"(datatype:jsonp). The "No transport" error is gone and a call goes to the webserver and is executed properly but it again gives error (may be parsererror) saying "jqueryxxxxx was not called". Below is what I used:
$.ajax({ url: WebServiceUrl + "/" + MethodName,
data: "profileName=amol&IsSyncRequired=false",
contentType: "application/x-www-form-urlencoded",
dataType: "jsonp",
jsonp: "jsonp",
complete: function(jqXhr, status) {
alert('result1');
if (status == "timeout" || status == 'parsererror') {
jqXhr.abort();
}
},
success: function(result) {
alert('result');
},
error: function(xhr, ajaxOptions, thrownError) {
alert(xhr.status); alert(thrownError);
alert(xhr.responseText);
}
});