我们可以通过在API请求中添加查询参数“format=json”,来确保返回的数据以JSON格式呈现。示例代码如下:
$.ajax({
url: "https://example.com/api/data",
data: {
format: "json"
},
success: function(response) {
console.log(response.childProperty);
}
});
上一篇:API没有显示任何内容