The first steps in trying to use all these technologies together. I have some problems.
Here is my server side:
[WebMethod (EnableSession = true)]
[ScriptMethod (ResponseFormat = ResponseFormat.Json)]
public string simplestMethod ()
{
return "Simplest method returned";
}
And here is my client side:
$ (document) .ready (function () {
$ ("a"). click (function (event) {
$ .ajax ({
type: "POST",
url: "http: // localhost: 53346 / d2 / TAPI.asmx / simplestMethod",
data: "{}",
contentType: "application / json; charset = utf-8",
dataType: "json",
success: function (data) {
alert (data.d);
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert ("Error Occured!" + "|" + XMLHttpRequest + "|" + textStatus + "|" +
errorThrown);
}
});
});
});
As a result, a warning appears that says:
An error has occurred! | [XMLHttpRequest object] | parseerror | undefined.
What parsing failed and why?
I should mention that calling the WS method directly works.
Many thanks!
source
share