1
您好我必须显示由jQuery在ListBox
返回的自动完成数据。 可能吗?如果可能请告诉我方式。我试图如下不工作。如何添加列表框中的jquery返回值
这里是我的jQuery:
<script type="text/javascript">
$(document).ready(function() {
SearchText();
});
function SearchText() {
$(".ss").autocomplete({
source: function (request, response) {
$('.ui-autocomplete').css('list-style-type', 'none').css('text-decoration', 'none');
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "/Services/SearchService.asmx/SearchCategory",
data: "{'searchtxt':'" + document.getElementById('MainContent_searchtext').value + "'}",
dataType: "json",
success: function (data) {
response(data.d);
$(data.d).each(function(){
$('#ListBox1').append(response(data.d));
});
}
});
}, minLength: 2
});
}
</script>