This是我正在尋找的。我從一個stackoverflow帖子中得到了這個例子。從第一個字母開始的角度定製搜索
但是,在我的情況下,我需要使用名字的第一個字母進行搜索。
這是json文件。
var userList = {
"user":[
{
"image": "adam.jpg",
"name": "Sanket Jain",
"email": "[email protected]",
"phone" : "9850987634"
},
{
"image": "ben.png",
"name": "Amar Patil",
"email": "[email protected]",
"phone" : "9951983334"
},
{
"image": "max.png",
"name": "Prasad Kulkarni",
"email": "[email protected]",
"phone" : "9253454634"
},
{
"image": "mike.png",
"name": "Tushar Salvi",
"email": "[email protected]",
"phone" : "9450987634"
}
]
};
謝謝@zamarrowski這工作:) – Tushar