我正在尝试对此处找到的 jquery mobile 使用 Andy Matthews 自动完成功能。我的客户端服务有一个使用参数的方法。我不确定如何更改客户端调用以接受参数?
这是我的客户端调用:
//WHERE DO I PUT INPUT PARAMETERS??
$("#searchBox").autocomplete({
method: 'POST',
target: $('#suggestions'),
source: "ClientService.svc/REST/GetStates",
link: 'target.html?term=',
minLength: 1
});
这是我的服务:
[OperationContract]
[WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest, ResponseFormat = WebMessageFormat.Json)]
public List<string> GetStates(string y)
{
List<string> x= GetData(y);
return x;
}