我希望不要刪除或刪除數組中的第一條記錄,並將其追加到我的頁面。我從下面的JSON文件中獲取數據:JSON數組 - 刪除第一個元素
$(data.content).each(function(index, content){
$("#htmlID").append('<span>' + content.myinfo + ');
});
{
"content":
[
{"myinfo":"Bill Clinton 095 years old. "},
{"myinfo":"Bill Clinton 195 years old. "},
{"myinfo":"Bill Clinton 295 years old. "},
{"myinfo":"Bill Clinton 295 years old. "}
]
}
當我附上我的數據頁面都出來完美的,但我會想跳過第一個元素(索引)......我基本上不想要帶回比爾克林頓095歲的特定輸出。
我該怎麼做? (grep?,刪除,刪除?)。
最簡單的方法是什麼?
只記得移回到移位元素;不要根據班次的原因而採取行動,而應根據原始變量的遺留情況採取行動。 –