监听input输入框实时更新数据
// 搜索游戏列表
$('#input_search').bind('input propertychange', function() {
let searchObj = $(this).val();
let url = $(this).attr("url")
let game_id = $(this).attr("game_id")
console.log(searchObj, url)
$('.object_list').show()
if(searchObj) {
$.post(url, {search_obj:searchObj, game_id:game_id}, function(ret){
$str = '';
console.log(ret,ret.done)
if(ret.done == true) {
let list = ret.data
for(let i=0;i<list.length;i++) {
$str += '<li class="object_item" data-title="'+list[i].title+'" onclick="gameChange('+list[i].value+')">'+list[i].title+'</li>';
}
}
$('.object_list').html($str)
}, 'JSON')
} else {
$('.object_list').hide()
}
});
让每一滴智慧绘制成一条不归路!