I have the following code to filter a JSON
, it works perfectly, the only problem I'm having is to choose the number of results displayed. (currently only displaying a single result).
var elemento = document.getElementById("galeria");
var SearchTag = function (jogo) {
var i = 0;
for (i = i; wallpapers.length > i; i += 1) {
if (wallpapers[i].jogo === jogo) {
return wallpapers[i];
}
}
return null;
};
var wall = SearchTag('tag-para-filtrar');
if (wall)
{
elemento.innerHTML +=
"" + wall.id + "" +
"" + wall.thumburl + "" +
"" + wall.nome + "" +
"" + wall.autor + "" +
"" + wall.protecao + "" +
"" + wall.tags + "" +
"" + wall.jogo + "" ;
}