当前位置: 代码迷 >> JavaScript >> json的key值为\u5317\u4eac这种编码,如何获取
  详细解决方案

json的key值为\u5317\u4eac这种编码,如何获取

热度:191   发布时间:2013-09-06 10:17:17.0
json的key值为\u5317\u4eac这种编码,怎么获取?
{"memo":"{\"\\u57ce\\u5e02\":\"\\u5317\\u4eac\",\"\\u8054\\u7cfb\\u7535\\u8bdd\":\"999\",\"\\u5730\\u5740\":\"\\u8bf4\\u8bf4\\u51e0\\u53f7\\u653e\\u5047\\u554a\",\"\\u90ae\\u7bb1\":\"jiangjie2012@gmail.com\",\"\\u7b80\\u4ecb\":\"\\u8bf4\\u8bf4\\u51e0\\u53f7\\u653e\\u5047\\u554a\",\"\\u7ecf\\u8425\\u8303\\u56f4\":\"\\u5a5a\\u5e86\"}","name":"\u5a5a\u793c\u7eaa","user_id":24,"logo_path":"merchant_logo/101376049270.jpg","license_path":"image_license/101376049270.jpg","city":"\u5317\u4eac","email":"jiangjie2012@gmail.com","pid":1}这是获取到的json

我想要取到简介的值

------解决方案--------------------
var json={"memo":"{\"\\u57ce\\u5e02\":\"\\u5317\\u4eac\",\"\\u8054\\u7cfb\\u7535\\u8bdd\":\"999\",\"\\u5730\\u5740\":\"\\u8bf4\\u8bf4\\u51e0\\u53f7\\u653e\\u5047\\u554a\",\"\\u90ae\\u7bb1\":\"jiangjie2012@gmail.com\",\"\\u7b80\\u4ecb\":\"\\u8bf4\\u8bf4\\u51e0\\u53f7\\u653e\\u5047\\u554a\",\"\\u7ecf\\u8425\\u8303\\u56f4\":\"\\u5a5a\\u5e86\"}","name":"\u5a5a\u793c\u7eaa","user_id":24,"logo_path":"merchant_logo/101376049270.jpg","license_path":"image_license/101376049270.jpg","city":"\u5317\u4eac","email":"jiangjie2012@gmail.com","pid":1};
json.memo=eval('('+json.memo+')');
alert(json.memo['简介']);

alert(JSON.stringify(json.memo));

------解决方案--------------------
unicode? js 直接 write出来的就会是汉字。或者你自己进行一下转码
  相关解决方案