I used $.ajax()
to consume a local .asmx webservice. Here's my code for the call:
$("#btnGetOne").click(function() {
$.ajax({
type: 'POST',
contentType: 'application/json; charset=utf-8',
url: 'http://localhost:53003/TestWebService.asmx/GetServant',
data: '{ "servant_id": "' + $("#txtServantID").val() + '" }',
dataType: 'json',
success: function(data, textStatus, jqXHR) {
var jsnData = $.parseJSON(data.d);
$('#DisplayArea').html(jsnData.Servant_Name);
},
error: function(jqXHR, textStatus, errorThrown) {
alert(textStatus + ' ' + errorThrown);
}
});
});
As you can see the ajax call executes when I click btnGetOne.
As in my question header, this works in jquery-1.4.1, but when I used jquery-1.6.2 I get an errorThrown
saying No Transport
.
Is there anything else I'm missing?