gpt4 book ai didi

javascript - 如何划分这个 jQuery 数据数组?

转载 作者:行者123 更新时间:2023-11-30 18:15:13 27 4
gpt4 key购买 nike

我有以下 javascript 数组:

[{
"id": "115",
"poster": "809",
"post": "alfa"
}, {
"id": "127",
"poster": "808",
"post": "beta"
}]​

我需要做什么才能将值提取到可用变量中?

最佳答案

试试这个,

var arr = [{"id":"115","poster":"809","post":"alfa"},{"id":"127","poster":"808","post":"beta"}];
for (i = 0; i < arr.length; i++)<br/>
document.write("id: " + arr[i].id + " poster: " + arr[i].poster + " post: " + arr[i].post + "<br/>");

关于javascript - 如何划分这个 jQuery 数据数组?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13436763/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com