62,074
社区成员
发帖
与我相关
我的任务
分享
public class KeywordAutocompleteService : System.Web.Services.WebService
{
[WebMethod]
public string GetKeywords(string key)
{
return Pages.GetAllKeywords(key);
}
}
Pages.GetAllKeywords()
是我的一个返回字符串的方法$.ajax({
url: "../KeywordAutocompleteService.asmx/GetKeywords",
type: "post",
data: { key: customerKey },
//dataType: 'json',
success: function(data, status) {
alert(data.text);
},
error: function(data, status) {
alert(data.responseText);
}});