所以我有一个JQuery的自动完成功能,
function autocomplete(){
$('.to_msg').autocomplete({
source: "ajax/auto_complete_ajax.php",
minLength:2,
select: function(event, ui){
var val = ui;
console.log(val);
}
});
}
从php结果的json_encode返回的对象是
Object
item: Object
label: "Melde Feliciano"
user_id : "5"
value : "Melde Feliciano"
__proto__:Object
我想要的只是返回user_id,即user_id的值为5,该怎么做?我需要从object
获取特定值