为了账号安全,请及时绑定邮箱和手机立即绑定

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

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

白猪掌柜的 2021-06-07 13:30:35
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 的东西,但没有用。
查看完整描述

1 回答

?
繁花不似锦

TA贡献1851条经验 获得超4个赞

item.kelimeler 永远不会显示,因为它只在 myObj2 中,并且 item 取自没有 kelimeler 的 dataJSON。

查看完整回答
反对 回复 2021-06-11
  • 1 回答
  • 0 关注
  • 124 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信