I believe it because you have dataType: "json" and it expects the content type of the response to be the same, but XML is returned. I bet the full event rises, but fails.
try
$.ajax({ type: "POST", url: "/Services/Tasks.asmx/HelloWorld", data: "{}", dataType: "json", contentType: "application/xml; charset=utf-8", success: function (data) { alert(data); }, complete: function (data) { alert(data); } });
UPDATE
I think because you are using .html (), you need to use text (). Also I do not know if you want to do this or not, but you have data in your warning, I assume that you wanted to use edata . The following worked for me:
jQuery.ajax({ type: "POST", url: "/yourURL", dataType: "xml", data: "{}", contentType: "application/xml; charset=utf-8", success: function(data) { edata = $(data).find("string").text(); alert(edata); } })
used2could
source share