【发布时间】:2013-03-08 18:48:28
【问题描述】:
我正在使用 jquery 自动完成 ui,我正在获取这样的 json 格式的数据
[{"organization_name":"health info"},{"organization_name":"Canada health"},{"organization_name": "org 1"}]
这是我的 jquery 代码,它没有正确显示 json 数据
$('input[name=profileOrg]').autocomplete({
source:'CHI_custom/customScripts/getorgname.php',
dataType: 'json',
minLength:2
});
谁能帮助如何在自动完成文本框下方显示数据?
【问题讨论】:
-
你读过文档吗
-
您的 JSON 中需要
label: str, value: str对。 -
@Ohgodwhy 你的意思是这样的
[{lable:organization_name,value:health info},{lable:organization_name,value:value2}] -
来源格式为[{value:'health info', label:'health info'}]