2016-03-06 79 views
0

我使用ASP JSON在http://www.aspjson.com/麻煩parseing JSON與ASPJSON傳統的ASP

我試圖解析salehistory在下面這張JSON響應。當我我可以得到所有的節點這樣

oJSON.data( 「屬性」),屬性對象下。項目(0).item( 「復古」)項目( 「上次更改」)

然而試着去深入我得到的錯誤

我已經試過

oJSON.data( 「屬性」)。項目(0).item( 「salehistory」)項目( 「salesearchdate」),但不返回任何東西。

我認爲它與事實有關,屬性是一個對象,SalesHistory是屬性內的對象,但我似乎無法從salehistory級別獲取值。

下面是我試圖解析的JSON結構。任何幫助,將不勝感激。 。

{ 
"status": { 
"version": "1.0.0", 
"code": 0, 
"msg": "SuccessWithResult", 
"total": 1, 
"page": 1, 
"pagesize": 10 
}, 
"property": [ 
{ 
"identifier": { 
"obPropId": 3464768712115, 
"fips": "12115", 
"apn": "0283080001", 
"apnOrig": "0283080001" 
}, 
"lot": { 
"lotSize1": 0.837 
}, 
"address": { 
"country": "US", 
"countrySubd": "FL", 
"line1": "7580 PRESERVATION DR", 
"line2": "SARASOTA, FL 34241", 
"locality": "Sarasota", 
"matchCode": "ExaStr", 
"oneLine": "7580 PRESERVATION DR, SARASOTA, FL 34241", 
"postal1": "34241", 
"postal2": "5201", 
"postal3": "R038" 
}, 
"location": { 
"accuracy": "Street", 
"elevation": 0, 
"latitude": "27.267342", 
"longitude": "-82.419812", 
"distance": 0, 
"geoid": "MT30003379,RS0000548079,SD67554,SS156496,SS156498,SS190868" 
}, 
"summary": { 
"propclass": "Single Family Residence/Townhouse", 
"propsubtype": "SINGLE FAMILY", 
"proptype": "SFR", 
"yearbuilt": 2005, 
"propLandUse": "SFR" 
}, 
"building": { 
"size": { 
"universalsize": 4256 
}, 
"rooms": { 
"bathstotal": 5, 
"beds": 4 
} 
}, 
"vintage": { 
"lastModified": "2015-9-11", 
"pubDate": "2015-10-7" 
}, 
"salehistory": [ 
{ 
"salesearchdate": "2009-3-30", 
"saleTransDate": "2009-3-30", 
"amount": { 
"saleamt": 1250000, 
"salerecdate": "2009-3-30", 
"saledisclosuretype": 0, 
"saledocnum": "37737", 
"saletranstype": "Resale" 
}, 
"calculation": { 
"priceperbed": 312500, 
"pricepersizeunit": 294 
} 
}, 
{ 
"salesearchdate": "2005-8-9", 
"saleTransDate": "2005-8-9", 
"amount": { 
"saleamt": 185000, 
"salerecdate": "2005-8-15", 
"saledisclosuretype": 0, 
"saledocnum": "181999", 
"saletranstype": "Resale" 
}, 
"calculation": { 
"priceperbed": 46250, 
"pricepersizeunit": 43 
} 
} 
] 
} 
] 
} 

回答

0

其實我已經弄清楚了。

由於它是屬性對象內的嵌套對象,我需要執行以下操作來訪問它。

回覆於oJSON.data( 「屬性」)。項(0).item( 「salehistory」)。項(0).item( 「量」)。項( 「saleamt」

添加.item(0)售後歷史記錄允許我訪問salehistory物品