我正在使用ASP.Net webservice JQuery自動完成。 我有ASP.Net Web服務被稱爲JQuery的(JSON)下拉作爲JQuery自動完成與ASp.Net web服務
$(document).ready(function() {
$("#txtTest").autocomplete({
source: function (request, response) {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "Webservice.asmx/GetNames",
data: "{'prefix':'" + request.term + "'}",
dataType: "json",
async: true,
success: function (data){
response($.map(data, function(item)
{ return item ; }));
},
error: function (result) {
alert("Due to unexpected errors we were unable to load data");
}
});
},
minLength:2
});
});
,我越來越對自動完成的下降輸出作爲
{"First":"Steve","Second":"AK"}
{"First":"Evet","Second":"EV"}
{"First":"Stevens","Second":"SV"}
如何顯示的單獨的「第一」項(如Steve,Evet,Stevens)作爲下拉式自動完成的輸出?
請幫幫我!
您好,感謝您的幫助。但你的詭計並沒有幫助我。你能否重新訪問你的代碼片段?我沒有得到任何價值。請幫幫我。 – pal
你有錯誤嗎?有什麼地方我們可以看到應用程序正在運行? –