JSON.parse这个是啥?

时间:2014-08-07 18:24:50   收藏:0   阅读:179
var jsontext = {"firstname":"Jesper","surname":"Aaberg","phone":["555-0100","555-0120"]};  
    var contact = JSON.parse(jsontext);  
    document.write(contact.surname + ", " + contact.firstname + ", "+ contact.phone);  

JSON.parse是用来把JSON字符串转换成对象的

JSON.parse这个是啥?,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!