我还是新手,JSON
所以我可能有一个非常愚蠢的问题。我该如何参考list.data[0].bom-item.descriptor
?我创建的警报声明对我不起作用。感谢帮助。
var txt='{"list": {"data": [{"bom-item": {"dmsID": 3949,"bomPath": "3951B3949","workspaceType": 6,"workspaceID": 8,"bomDepthLevel": 1,"quantity": 1,"formattedQuantity": "1.0","descriptor": "500-0059-000 - FCI, P681-C01 SKU77 (900-60681-0077-400) [REV:D]","revision": "D","units": "EA","itemNumber": 1,"assembly": false,"cost": 0,"isPinned": false,"quoteID": 0,"isUsingDefaultQuote": false,"leaf": false,"redlinedCost": -1,"redlineAddition": false,"redlineAgainstVersion": -1,"redlineDeletion": false,"totalWeight": 1,"lifecycleStatus": "Production","hasSourcing": false,"fields": null}}]}}'
alert(txt.list.data[0].bom-item.descriptor);