2011年10月23日

JS json object 与 string 相互转换

摘要: object转stirngfunctionobj2str(o){varr=[];if(typeofo=="string"||o==null){returno;}if(typeofo=="object"){if(!o.sort){r[0]="{"for(variino){r[r.length]=i;r[r.length]=":";r[r.length]=obj2str(o[i]);r[r.length]=",";}r[r.length-1]="}"}else{r[0]=&quo 阅读全文

posted @ 2011-10-23 00:20 wuye1200 阅读(245) 评论(0) 推荐(0) 编辑

导航