Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

json search javascript

var results = [];
var searchField = "name";
var searchVal = "my Name";
for (var i=0 ; i < obj.list.length ; i++)
{
    if (obj.list[i][searchField] == searchVal) {
        results.push(obj.list[i]);
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #json #search #javascript
ADD COMMENT
Topic
Name
6+5 =