我正在尝试从我的 php api 返回的这个 json 字符串中获取 DishName。
json字符串是
["Spicy.com Specials",{"CatID":31,"CatName":"Spicy.com Specials","DishName":"Kashmiri Chicken","DishID":52,"DishDesc":"Cooked with lychees and banana in a lovely sweet and creamy sauce","DishPrice":6.99,"CatDescription":" "},{"CatID":31,"CatName":"Spicy.com Specials","DishName":"Telapia Fish","DishID":51,"DishDesc":"Lightly spiced fillet, a very popular white fish made with peppers, onions and spices in medium sauce","DishPrice":6.99,"CatDescription":" "},
我的钛代码是
var cats = eval('('+this.responseText+')');
alert(cats[0]);
这得到了我的“Foo.com Specials”但是我需要 DishName,任何帮助将不胜感激谢谢