{
  "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的值?js  jsonjsonjs

解决方案 »

  1.   

    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  就是
      

  2.   

    我看了  json 外面多套了一个<pre></pre>标签,是无法解析json的原因,但是为什么会多套这样的标签,是从哪里来的?
      

  3.   

    <pre></pre> 是为了保持原样显示,你后台生成时有加?,直接生成时删除<pre> 或者前台先删除后解析
      

  4.   

    给大家分享一下:用截取字符串的方法,取出json数据,再用eval();转化为json,就能用json.xxx获取值了。