我无法解析多行 json 数组并将其放入 html 元素中

var dataJSON = '[{"FeeType":"Domestic POS Declined Fee","FeeDescription":"per declined transaction","FeeAmount":"0.50"},{"FeeType":"Domestic PIN Declined Fee","FeeDescription":"per declined transaction","FeeAmount":"0.50"},{"FeeType":"International POS Declined Fee","FeeDescription":"per declined transaction","FeeAmount":"0.95"},{"FeeType":"International PIN Declined Fee ","FeeDescription":"per declined transaction","FeeAmount":"0.95"},{"FeeType":"ATM Domestic Fee <sup>1</sup>","FeeDescription":"One (1) no cost ATM withdrawal per deposit1, then $1.75 per transaction thereafter","FeeAmount":"1.75"},{"FeeType":"Domestic ATM Balance Inquiry Fee <sup>1</sup>","FeeDescription":"per ATM Balance Inquiry","FeeAmount":"0.50"},{"FeeType":"Domestic ATM Declined Fee <sup>1</sup>","FeeDescription":"per declined transaction","FeeAmount":"0.50"},{"FeeType":"International ATM Withdrawal Fee <sup>1</sup>","FeeDescription":"per transaction","FeeAmount":"3.00"},{"FeeType":"International ATM Balance Fee ","FeeDescription":"per ATM Balance Inquiry","FeeAmount":"0.95"},{"FeeType":"International ATM Declined Fee","FeeDescription":"per declined transaction","FeeAmount":"0.95"},{"FeeType":"OTC 

我在网上找到了一些代码。var dataObject = JSON.parse(dataJSON); 这非常有效,但我很难管理单行 json 数组。我只想使用 myObj2 并访问标题和描述。

如何访问 myObj2 > 'keliemeler' 中的元素。我试过 item.kelimeler.title 的东西,但没有用。

白猪掌柜的
浏览 125回答 1
1回答

繁花不似锦

item.kelimeler 永远不会显示,因为它只在 myObj2 中,并且 item 取自没有 kelimeler 的 dataJSON。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript