JSON快速转义
//将Obj转为字符串Obj后再进行JSON转义 JSON.stringify(Object).replace(/\\/g,"\\\\").replace(/\"/g,"\\\""); //得到的结果: {\"id\":100200,\"codes\":\"1111\"},{\"id\":100172,\"codes\":\"2020\"} //去除转义 Object= Object.replace(/\\\\/g,"\\").replace(/\\\"/g,'\"'); //结果 {"id":100200,"codes":"1111"},{"id":100172,"codes":"2020"}