listToJson.js //js将list字符串转为json对象function listToJson(list){list = list.replace(/\s/g, "");list = list.replace(/=/g,":");var reg = /([^\:\{\}\[\]\,]+)\:([^\:\,\{\}\[\]]*)/g;list = list.replace(reg,"\"$1\":\"$2\"");var json =
//js将list字符串转为json对象 function listToJson(list){ list = list.replace(/\s/g, ""); list = list.replace(/=/g,":"); var reg = /([^\:\{\}\[\]\,]+)\:([^\:\,\{\}\[\]]*)/g; list = list.replace(reg,"\"$1\":\"$2\""); var json = $.parseJSON(list); return json; }