我停2天,爲尋找答案,
這是我的數據是這樣的:jQuery和JSON數組
場行有這樣的數據:
rows :
[
[
"1",
"test1",
"pw85798",
"GM",
"38475786",
"yr",
"m",
"20-11-1972",
"100",
"[email protected]"
],
[
"11",
"test2",
"pw78423786",
"media",
"",
"yrer",
"m",
"11-05-1990",
"1",
"[email protected]"
],
我有2個文本框: usetext
和pwstext
我想要我的循環取文本中的2個值並查看數組內部,如果usrtext = "test1"
和pswtext = "pw85798"
。然後將出現<div>
。如果沒有,提醒"error"
我需要這段代碼繼續。
我嘗試這樣做:
db.openDoc(id, {
success:function (result) {
// Update revision input field
$("#revision").val(result.rows[0,1]);
它返回所有的一級指標:
1, test1, pw85798, GM, , 38475786, yr, m, ...
你是說,oyu有一個JSON數據數組,你想比較輸入的數據用戶? –
那麼在那2天裏,你嘗試了什麼? – musefan
此外,安全似乎不是你的問題,所以你可能只是有一個「讓我進來」按鈕 – musefan