0
我有帶有users_id數組的JSON文件。在這個陣列上,我有活動用戶,所以這個數字是不連續的。我如何檢查(在jQuery上)職位數users_id = 18(answer = 3)?接下來我想從其他字符串讀取值,以便我可以閱讀json.data_todo_counter [3]。JS和JSON - 如何查找位置號碼
{
"users_id": [1, 2, 3, 18, 24],
"data_chat_timeread": [0, 0, 0, 0, 0],
"data_chat_timecurrent": [100, 0, 0, 0, 0],
"data_chat_counter": [4, 0, 0, 0, 0],
"data_todo_counter": [2, 0, 0, 0, 0]
}
要找到18,解析JSON,然後在該特定數組上使用數組'.indexOf()'方法。 – nnnnnn