У меня этот простой веб-сервис
<WebMethod()> _
Public Function HelloWorld() As String
Return "[1255545454545,4]"
End Function
и это будет на стороне клиента>
$.ajax({
type: "POST",
url: "WebService1.asmx/HelloWorld",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(response) {
alert(response);
},
failure: function(msg) {
alert(msg);
}
});
});
как я могу получить реальное значение вместо [объекта объекта], который я получаю
Попробуйте обратиться к response.d. Это функция Asp.Net.
$.ajax({
type: "POST",
url: "WebService1.asmx/HelloWorld",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(response) {
alert(response.d);
alert(response.d[0]);
alert(JSON.stringify(response));
},
failure: function(msg) {
alert(msg);
}
});