[英]convert the data received from url to json format
What you're seeing is the browser attempting to show you the structure of the data.您看到的是浏览器试图向您展示数据的结构。 The actual structure is an array of objects as you would write it in code is:
实际结构是一个对象数组,就像您在代码中编写的那样:
[{firstname: "Fozzy", lastname: "The Foz", title: "Garbage Disposal..."}, {...}, {...}]
To convert the variable data
to a JSON string, you would call:要将变量
data
转换为 JSON 字符串,您可以调用:
JSON.stringify(data);
This will return:这将返回:
"[{"firstname": "Fozzy", "lastname": "The Foz", "title" : "Garbage Disposal..."}, {...}, {...}]"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.