secret
Created

  • Download Gist
soclose.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
var matchKey = function(k,v,j){
k = k || 'id'; //key
v = v || ''; //value
j = j || PAGES; //json
for(x in j){
if(j[x][k] == v){
return j[x];
}
if(j[x].subpages){
var result = matchKey(k,v,j[x].subpages);
if(result !== undefined){
return result;
}
}
}
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.