js解析json求大神解答
{
"status" : {
"code" : 0,
"messages" : null
},
"userPicture" : {
"id" : 183,
"name" : "1111111",
"status" : 0,
"createdDate" : "2013-08-28 19:55:05",
"lastUpdated" : "2013-08-28 19:55:05",
"userId" : 1000,
"accessUrl" : "http://180.169.62.234:9090/mytv/User/1000/76868889.img"
}
}
这是json,我如何用js获取accessUrl的值?
------解决方案--------------------var josn={
"status" : {
"code" : 0,
"messages" : null
},
"userPicture" : {
"id" : 183,
"name" : "1111111",
"status" : 0,
"createdDate" : "2013-08-28 19:55:05",
"lastUpdated" : "2013-08-28 19:55:05",
"userId" : 1000,
"accessUrl" : "http://180.169.62.234:9090/mytv/User/1000/76868889.img"
}
}
json.userPicture.accessUrl 就是
------解决方案--------------------<pre></pre> 是为了保持原样显示,你后台生成时有加?,直接生成时删除<pre> 或者前台先删除后解析