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
浙公网安备 33010602011771号