JSON.parse 解析json字符串时,遇换行符报错

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_29755359/article/details/81912169
string = string.replace(/\n/g,"\\n").replace(/\r/g,"\\r");

参考

https://www.cnblogs.com/xiaozhuyuan/p/7098235.html

https://www.cnblogs.com/alsf/p/8662189.html

猜你喜欢

转载自blog.csdn.net/qq_29755359/article/details/81912169