我正在开发一个前端和后端分离的网站。我用jQuery来发送请求,得到的结果作为一个JSON对象:如何使用jquery处理多个json对象
{
"item": [
],
"shop": [
],
"user": [
{
"user_id": "9",
"full_name": "Minh Duc",
"email": "[email protected]",
"fb_link": "https:\/\/www.facebook.com\/SieuNhan183",
"user_name": "Duc",
"password": "37cd769165eef9ba6ac6b4a0fdb7ef36",
"level": "0",
"admin": "0",
"dob": "1996-03-18",
"location": "Ho Chi Minh",
"user_image_url": null
}
]
}
现在我找到一种方法,从对象用户获取数据。我怎样才能做到这一点与JavaScript?
$ jsonObject.user [0]将是你想要的用户对象。使用 。 (点)来访问你想要的对象属性 –
[没有这样的东西作为“JSON对象”](http://benalman.com/news/2010/03/theres-no-such-thing-asa-a- JSON /) – Andreas