【发布时间】:2011-04-02 11:27:43
【问题描述】:
我正在使用 jquery.getJson() 来检索由我的 php 脚本创建的 json 对象。
如果我删除位置数组,它会起作用。但是我需要位置数组来填充组合框。
我的格式化 json 如下。任何建议我如何让它与一个 json 查询而不是 2 一起工作。
{ "ContactID" : "1", "CustomerID" : "1", "FirstName" : "john", "LastName" : "smith", "Position" : "General Manager", "ContactNumber" : "234523455", "FaxNumber" : "235235234", "LocationSelected" : "1", "Default" : "default", locations : {0 : { "addressID" : "1" , "description" : "Street Address" }}}
我也试过这样
{ "ContactID" : "1", "CustomerID" : "1", "FirstName" : "john", "LastName" : "smith", "Position" : "General Manager", "ContactNumber" : "234523455", "FaxNumber" : "235235234", "LocationSelected" : "1", "Default" : "default", locations : [{ "addressID" : "1" , "description" : "Street Address" }]}
【问题讨论】: