I am trying to call webservice method from Jquery ajax.
Here is my jquery code,
function abc() {
alert("");
$.ajax({
type: "Get",
url: "abc.asmx/HelloWorld",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
error: function (errorThrown) {
console.log(errorThrown.d);
alert(errorThrown + "what's wrong?");
},
success: function (msg) {
console.log(msg.d);
alert(msg.d);
return false;
// Do something interesting here.
}
});
return false; }
and my web method is following,
[WebMethod]
public string HelloWorld() {
return "Hello World";
}
the jquery error event is keep occuring. Not sure why it's happening
any help will be appreciated
thanks