<WebMethod()> Public Shared Function gtet() As String
...
Dim GET = uClass.GetSets(dbuser, dbparam1)
...
End Function
和
$(document).ready(function ()
{
data = { };
var jsondata = $.toJSON(data);
$.ajax({
type: "GET",
url: "index.aspx/gtet",
data: jsondata,
contentType: "application/json; charset=utf-8",
dataType: "text json",
beforeSend: function (xhr)
{
xhr.setRequestHeader("Content-type",
"application/json; charset=utf-8");
},
success: function (cget)
{
alert(cget);
},
error: function (XMLHttpRequest, textStatus, errorThrown)
{
window.location.reload();
}
});
}
我这样做对吗?我需要从 Dim GET 中拉出字符串