m0_37676512
龙猫12138
2017-10-26 02:01

servlet中使用gson把Vector的内容变成了一个json字符串,js中应该如何解析呢?

  • java
  • servlet
  • json
  • gson
  • javascript
 [{"name":"Abzu","goodid":"A0001","description":"save the sea , find the secret","price":36.0,"picture":"image/Abzu.jpg"},{"name":"Skyrim","goodid":"A0002","description":"kill the evil dragon , save the human","price":64.0,"picture":"image/Skyrim.jpg"},{"name":"DarkSoul","goodid":"A0003","description":"be the undead , find the secret","price":126.0,"picture":"image/DarkSoul.jpg"}]

最后得到了一个这样的字符串,我希望在js中解析这个字符串,然后把内容都展现在html页面上,但是应该如何做呢?这个转换的是一个带类型的Vector,属性只有字符串和数字。

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答