【发布时间】:2019-06-27 07:53:57
【问题描述】:
我正在尝试将 Json 数组中的内容从 api 显示到我的 html 中。我该怎么做?
这是我的 Json 数组。
{
page: 2,
per_page: 3,
total: 12,
total_pages: 4,
data: [
{
id: 4,
first_name: "Eve",
last_name: "Holt",
avatar:
"https://s3.amazonaws.com/uifaces/faces/twitter/marcoramires/128.jpg"
},
{
id: 5,
first_name: "Charles",
last_name: "Morris",
avatar:
"https://s3.amazonaws.com/uifaces/faces/twitter/stephenmoon/128.jpg"
},
{
id: 6,
first_name: "Tracey",
last_name: "Ramos",
avatar: "https://s3.amazonaws.com/uifaces/faces/twitter/bigmancho/128.jpg"
}
]
};
我有 JQuery Ajax 请求从 API 获取数据:“https://reqres.in/api/users?page=2”
【问题讨论】:
-
您想在
html的哪个位置显示以及如何显示。我的意思是table或类似的东西 -
这个问题已经被问了数百次了。在请其他人为您做之前,请先尝试并进行一些研究。见:How much research effort is expected of Stack Overflow users?
-
如果您有新问题,请发布新问题,而不是完全编辑您的问题。
标签: javascript jquery html json ajax