拆分字符串并获取字符串的一部分

时间:2016-05-15 03:01:24

标签: javascript json ajax string

我使用AJAX请求返回以下字符串:

{"city":"Seattle","country":"US","weather":[{"icon":"10d","temperature":46.6},{"icon":"13d","temperature":43.16},{"icon":"13d","temperature":43.43},{"icon":"13d","temperature":40.55},{"icon":"01d","temperature":37.33},{"icon":"10d","temperature":41.86},{"icon":"10d","temperature":43.32}]}

我想拆分那个字符串,这样我就可以获得每个图标字符串值(" 10d"," 13d"等)以及每个温度(&#34) ; 46.6"," 43.16"等等)但我不完全确定如何去做。好像我需要拆分字符串,但我不确定这是不是最好的方法呢

0 个答案:

没有答案