I used $.ajax() to use the local .asmx web service. Here is my code to 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 is executed when I press btnGetOne.
As in my question title, this works in jquery-1.4.1, but when I used jquery-1.6.2, I get errorThrown No Transport message.
Is there anything else I'm missing?
source share