更新 对不起,我应该更好地澄清这一点!我使用 2 阶段 web 服务,第一次调用返回完整的街道地址和一个密钥,然后可以反过来使用该密钥返回地址部分。为此,我想使用 jQuery Autocomplete 组件,但我不知道该怎么做。
这是第一个返回带有密钥的完整地址的 Web 服务,然后可以使用该密钥对地址部分进行后续请求:
jsonCallback({
"Address": [
{
"Moniker": "03OAUSAQXcBwEDAQAAAAAvuBHAAAAAADMxABQA",
"FullAddress": "31KhanRoad,GURRANANGNSW2460"
},
{
"Moniker": "0XOAUSAQXcBwEDAQAAAAAvuBHAAAAAADMzABQA",
"FullAddress": "33KhanRoad,GURRANANGNSW2460"
},
{
"Moniker": "0POAUSAQXcBwEDAQAAAAAvuBHAAAAAADM1ABQA",
"FullAddress": "35KhanRoad,GURRANANGNSW2460"
},
{
"Moniker": "0NOAUSAQXcBwEDAQAAAAAvuBbAAAAAAAAUAA--",
"FullAddress": "43KhanRoad,GURRANANGNSW2460"
}
]
})
这是返回特定选择的JSON的后续调用 - 这是我最终需要保存在数据库中的信息
生成的 JSON 对象:
jsonCallback({"Result":"OK","Address":{"DPID":"68847810","Full Address":"20 Some Ct, TRUGANINA VIC 3029","Unit Number":"","Street Number":"19","Street Name":"Khan","Street Type":"Court","Street Type Suffix":"","Suburb":"TRUGANINA","State":"VIC","Postcode":"3029","Building Name":"","Building Name 2":""}});