// 方法1设置响应体数据的类型 json数据格式自动转换**
xhr.responseType='json';
console.log(xhr.response);
方法2手动转换
JSON.parse(xhr.response)
<!--此时的xhr 返回的response为json对象的形式-->
如何是后台相应response返回json对象形式
最新推荐文章于 2024-05-15 17:02:41 发布
// 方法1设置响应体数据的类型 json数据格式自动转换**
xhr.responseType='json';
console.log(xhr.response);
方法2手动转换
JSON.parse(xhr.response)
<!--此时的xhr 返回的response为json对象的形式-->

被折叠的 条评论
为什么被折叠?