键上的json javascript筛选器值
最终的输出应该是所有具有桌面类别的图像的列表:Jackpots “所有游戏”按钮显示所有图像:键上的json javascript筛选器值,javascript,arrays,json,Javascript,Arrays,Json,最终的输出应该是所有具有桌面类别的图像的列表:Jackpots “所有游戏”按钮显示所有图像: //List all images in the ol #oneall $.each(data.items, function(i, f) { $("#oneall").append("<li><img src='" + f.image_180x100 + "' / ></li>"); }); 类型错误:元
//List all images in the ol #oneall
$.each(data.items, function(i, f) {
$("#oneall").append("<li><img src='" + f.image_180x100 + "' / ></li>");
});
类型错误:元素未定义
return elems.length === 1 && elem.nodeType === 1 ?
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>game</title>
<link href="//cdn.rawgit.com/noelboss/featherlight/1.7.5/release/featherlight.min.css" type="text/css" rel="stylesheet" />
<link>
<script src="//code.jquery.com/jquery-latest.js"></script>
<script src="//cdn.rawgit.com/noelboss/featherlight/1.7.5/release/featherlight.min.js" type="text/javascript" charset="utf-8"></script>
<!--<script type="text/javascript" src="foo.js"></script>-->
<style>
li {
float: left;
}
ol {
list-style-type: none;
}
div {
display: none;
}
</style>
</head>
<body>
<h3>Test</h3>
<button type="button" class="btn btn-primary" id="all">All Games</button>
<button type="button" class="btn btn-primary" id="jackpots">Jackpots</button>
<button type="button" class="btn btn-primary" id="popular">Popular Games</button>
<button type="button" class="btn btn-primary" id="slots">Slots</button>
<div id="one">
<ol id="oneall">
<li data-featherlight></li>
</ol>
</div>
<div id="two">
<ol id="twopopular"></ol>
</div>
<script>
var data = {
"items": [{
"title": "Frankie Dettori",
"image_180x100": "https://www.supercasino.com/assets/GB/games/sc_fdt_180x100.jpg",
"desktop_categories_ids": "39,3,79",
"desktop_categories": "Popular Games,Slots,All Games"
}, {
"title": "Frankie Dettori",
"image_180x100": "https://www.supercasino.com/assets/GB/games/sc_fdt_180x100.jpg",
"desktop_categories_ids": "39,3,79",
"desktop_categories": "Popular Games,Slots,All Games"
}, {
"title": "Desert Treasure Desktop",
"image_180x100": "https://www.supercasino.com/assets/GB/games/sc_dt_180x100.jpg",
"desktop_categories_ids": "3,79",
"desktop_categories": "Slots,All Games"
}, {
"title": "Vacation Station",
"image_180x100": "https://www.supercasino.com/assets/GB/games/sc_er_180x100.jpg",
"desktop_categories_ids": "3,79",
"desktop_categories": "Slots,All Games"
}, {
"title": "Vacation Station",
"image_180x100": "https://www.supercasino.com/assets/GB/games/sc_er_180x100.jpg",
"desktop_categories_ids": "3,79",
"desktop_categories": "Slots,All Games"
}, {
"title": "Hulk 25 Line",
"image_180x100": "https://www.supercasino.com/assets/GB/games/Hulk_180x100.jpg",
"desktop_categories_ids": "39,3,4,79",
"desktop_categories": "Popular Games,Slots,Jackpots,All Games"
}, {
"title": "Jackpot Darts",
"image_180x100": "https://www.supercasino.com/assets/GB/games/sc_drts_180x100.jpg",
"desktop_categories_ids": "3,4,79",
"desktop_categories": "Slots,Jackpots,All Games"
}, {
"title": "Genie Hi-Lo",
"image_180x100": "https://www.supercasino.com/assets/GB/games/sc_ghl_180x100.jpg",
"desktop_categories_ids": "79",
"desktop_categories": "All Games"
}, {
"title": "Gladiator",
"image_180x100": "https://www.supercasino.com/assets/GB/games/sc_glr_180x100.jpg",
"desktop_categories_ids": "39,3,79",
"desktop_categories": "Popular Games,Slots,All Games"
}, {
"title": "Mr.Cashback",
"image_180x100": "https://www.supercasino.com/assets/GB/games/sc-mcb-180x100.jpg",
"desktop_categories_ids": "3,79",
"desktop_categories": "Slots,All Games"
}, {
"title": "Great Blue",
"image_180x100": "https://www.supercasino.com/assets/GB/games/sc-bib-180x100.jpg",
"desktop_categories_ids": "39,3,79",
"desktop_categories": "Popular Games,Slots,All Games"
}, {
"title": "Wild Games",
"image_180x100": "https://www.supercasino.com/assets/GB/games/SC_WILDGAMES_180x100.jpg",
"desktop_categories_ids": "3,79",
"desktop_categories": "Slots,All Games"
}, {
"title": "Kong: Eighth Wonder of the World",
"image_180x100": "https://www.supercasino.com/assets/GB/games/SC_Kong_180x100.jpg",
"desktop_categories_ids": "3,79",
"desktop_categories": "Slots,All Games"
}, {
"title": "Iron Man 2 - 25 Line",
"image_180x100": "https://www.supercasino.com/assets/GB/games/Ironman2_180x100.jpg",
"desktop_categories_ids": "3,4,79",
"desktop_categories": "Slots,Jackpots,All Games"
}, {
"title": "Iron Man",
"image_180x100": "https://www.supercasino.com/assets/GB/games/IronMan_180x100.jpg",
"desktop_categories_ids": "3,4,79",
"desktop_categories": "Slots,Jackpots,All Games"
}, {
"title": "UK Blackjack",
"image_180x100": "https://www.supercasino.com/assets/GB/games/sc_bjuk_180x100_v2.jpg",
"desktop_categories_ids": "2,79",
"desktop_categories": "Blackjack,All Games"
}, {
"title": "21 Duel Blackjack",
"image_180x100": "https://www.supercasino.com/assets/GB/games/sc_bj21d_180x100_v2.jpg",
"desktop_categories_ids": "2,79",
"desktop_categories": "Blackjack,All Games"
}, {
"title": "Fantastic Four",
"image_180x100": "https://www.supercasino.com/assets/GB/games/FantasticFour_super_180x100.jpg",
"desktop_categories_ids": "3,4,79",
"desktop_categories": "Slots,Jackpots,All Games"
},
{
"title": "The Mummy",
"image_180x100": "https://www.supercasino.com/assets/GB/games/SC_GAME_MUMMY.jpg",
"desktop_categories_ids": "3,79",
"desktop_categories": "Slots,All Games"
}, {
"title": "Desert Treasure II",
"image_180x100": "https://www.supercasino.com/assets/GB/games/sc-dt2-180x100.jpg",
"desktop_categories_ids": "3,79",
"desktop_categories": "Slots,All Games"
}, {
"title": "X Men",
"image_180x100": "https://www.supercasino.com/assets/GB/games/Xmen_180x100.jpg",
"desktop_categories_ids": "3,4,79",
"desktop_categories": "Slots,Jackpots,All Games"
}, {
"title": "Daredevil",
"image_180x100": "https://www.supercasino.com/assets/GB/games/Daredevil_180x100.jpg",
"desktop_categories_ids": "3,4,79",
"desktop_categories": "Slots,Jackpots,All Games"
}, {
"title": "Rocky",
"image_180x100": "https://www.supercasino.com/assets/GB/games/sc_rky_180x100.jpg",
"desktop_categories_ids": "3,79",
"desktop_categories": "Slots,All Games"
}, {
"title": "Hulk 50 Line",
"image_180x100": "https://www.supercasino.com/assets/GB/games/Hulk50_180x100.jpg",
"desktop_categories_ids": "3,4,79",
"desktop_categories": "Slots,Jackpots,All Games"
}, {
"title": "Football Fans",
"image_180x100": "https://www.supercasino.com/assets/GB/games/SC_GAME_FOOTBALL_FANS.jpg",
"desktop_categories_ids": "3,79",
"desktop_categories": "Slots,All Games"
}, {
"title": "Hot Gems",
"image_180x100": "https://www.supercasino.com/assets/GB/games/SC_GAME_HOT_GEMS.jpg",
"desktop_categories_ids": "3,79",
"desktop_categories": "Slots,All Games"
}, {
"title": "Wings of Gold",
"image_180x100": "https://www.supercasino.com/assets/GB/games/SC_GAME_WINGS_OF_GOLD.jpg",
"desktop_categories_ids": "3,79",
"desktop_categories": "Slots,All Games"
}, {
"title": "Goddess of Life",
"image_180x100": "https://www.supercasino.com/assets/GB/games/SC_GAME_GODDESS_OF_LIFE.jpg",
"desktop_categories_ids": "3,79",
"desktop_categories": "Slots,All Games"
}, {
"title": "Vikingmania",
"image_180x100": "https://www.supercasino.com/assets/GB/games/SC_GAME_VIKING_MANIA.jpg",
"desktop_categories_ids": "3,79",
"desktop_categories": "Slots,All Games"
}, {
"title": "Elektra",
"image_180x100": "https://www.supercasino.com/assets/GB/games/Elektra_180x100.jpg",
"desktop_categories_ids": "3,4,79",
"desktop_categories": "Slots,Jackpots,All Games"
}, {
"title": "Fantastic Four 50 Line",
"image_180x100": "https://www.supercasino.com/assets/GB/games/FantasticFour50_super_180x100.jpg",
"desktop_categories_ids": "39,3,4,79",
"desktop_categories": "Popular Games,Slots,Jackpots,All Games"
}, {
"title": "Iron Man 2 50 Line",
"image_180x100": "https://www.supercasino.com/assets/GB/games/IronMan250_180x100.jpg",
"desktop_categories_ids": "3,4,79",
"desktop_categories": "Slots,Jackpots,All Games"
}, {
"title": "Wild Spirit",
"image_180x100": "https://www.supercasino.com/assets/GB/games/SC_WILDSPIRIT_180x100.jpg",
"desktop_categories_ids": "3,79",
"desktop_categories": "Slots,All Games"
}
]
};
//List all images in the ol #oneall
$.each(data.items, function(i, f) {
$("#oneall").append("<li><img src='" + f.image_180x100 + "' / ></li>");
});
//toggles the div #one with the ol #oneall
$('#all').click(function() {
$("#one").toggle();
});
//filter all title with the value "Vikingmania". This part doesn't work
$.filter(data.items, function(x) { return x.title.search("Vikingmania");
$("#twopopular").append("<li><p>'" + x.title + "'</p></li>");
});
//toggles the div #two with the ol #twopopular
$('#popular').click(function() {
$("#two").toggle();
});
</script>
</body>
</html>
返回elems.length==1&&elem.nodeType==1?
游戏
李{
浮动:左;
}
ol{
列表样式类型:无;
}
div{
显示:无;
}
试验
所有游戏
头奖
流行游戏
槽
风险值数据={
“项目”:[{
“标题”:“Frankie Dettori”,
“图像_180x100”:”https://www.supercasino.com/assets/GB/games/sc_fdt_180x100.jpg",
“桌面分类ID”:“39,3,79”,
“桌面游戏类别”:“流行游戏、老虎机、所有游戏”
}, {
“标题”:“Frankie Dettori”,
“图像_180x100”:”https://www.supercasino.com/assets/GB/games/sc_fdt_180x100.jpg",
“桌面分类ID”:“39,3,79”,
“桌面游戏类别”:“流行游戏、老虎机、所有游戏”
}, {
“标题”:“沙漠宝藏桌面”,
“图像_180x100”:”https://www.supercasino.com/assets/GB/games/sc_dt_180x100.jpg",
“桌面类别ID”:“3,79”,
“桌面_类别”:“老虎机,所有游戏”
}, {
“标题”:“度假站”,
“图像_180x100”:”https://www.supercasino.com/assets/GB/games/sc_er_180x100.jpg",
“桌面类别ID”:“3,79”,
“桌面_类别”:“老虎机,所有游戏”
}, {
“标题”:“度假站”,
“图像_180x100”:”https://www.supercasino.com/assets/GB/games/sc_er_180x100.jpg",
“桌面类别ID”:“3,79”,
“桌面_类别”:“老虎机,所有游戏”
}, {
“标题”:“绿巨人25号线”,
“图像_180x100”:”https://www.supercasino.com/assets/GB/games/Hulk_180x100.jpg",
“桌面分类ID”:“39,3,4,79”,
“桌面游戏类别”:“流行游戏、老虎机、Jackpot、所有游戏”
}, {
“标题”:“Jackpot飞镖”,
“图像_180x100”:”https://www.supercasino.com/assets/GB/games/sc_drts_180x100.jpg",
“桌面类别ID”:“3,4,79”,
“桌面游戏类别”:“老虎机、Jackpot、所有游戏”
}, {
“标题”:“妖怪你好,你好”,
“图像_180x100”:”https://www.supercasino.com/assets/GB/games/sc_ghl_180x100.jpg",
“桌面类别ID”:“79”,
“桌面游戏类别”:“所有游戏”
}, {
“头衔”:“角斗士”,
“图像_180x100”:”https://www.supercasino.com/assets/GB/games/sc_glr_180x100.jpg",
“桌面分类ID”:“39,3,79”,
“桌面游戏类别”:“流行游戏、老虎机、所有游戏”
}, {
“头衔”:“现金返还先生”,
“图像_180x100”:”https://www.supercasino.com/assets/GB/games/sc-mcb-180x100.jpg",
“桌面类别ID”:“3,79”,
“桌面_类别”:“老虎机,所有游戏”
}, {
“标题”:“伟大的蓝色”,
“图像_180x100”:”https://www.supercasino.com/assets/GB/games/sc-bib-180x100.jpg",
“桌面分类ID”:“39,3,79”,
“桌面游戏类别”:“流行游戏、老虎机、所有游戏”
}, {
“标题”:“野生游戏”,
“图像_180x100”:”https://www.supercasino.com/assets/GB/games/SC_WILDGAMES_180x100.jpg",
“桌面类别ID”:“3,79”,
“桌面_类别”:“老虎机,所有游戏”
}, {
“标题”:“香港:世界第八大奇迹”,
“图像_180x100”:”https://www.supercasino.com/assets/GB/games/SC_Kong_180x100.jpg",
“桌面类别ID”:“3,79”,
“桌面_类别”:“老虎机,所有游戏”
}, {
“标题”:“铁人2-25行”,
“图像_180x100”:”https://www.supercasino.com/assets/GB/games/Ironman2_180x100.jpg",
“桌面类别ID”:“3,4,79”,
“桌面游戏类别”:“老虎机、Jackpot、所有游戏”
}, {
“头衔”:“钢铁侠”,
“图像_180x100”:”https://www.supercasino.com/assets/GB/games/IronMan_180x100.jpg",
“桌面类别ID”:“3,4,79”,
“桌面游戏类别”:“老虎机、Jackpot、所有游戏”
}, {
“标题”:“英国21点”,
“图像_180x100”:”https://www.supercasino.com/assets/GB/games/sc_bjuk_180x100_v2.jpg",
“桌面类别ID”:“2,79”,
“桌面游戏类别”:“21点,所有游戏”
}, {
“标题”:“21决斗21点”,
“图像_180x100”:”https://www.supercasino.com/assets/GB/games/sc_bj21d_180x100_v2.jpg",
“桌面类别ID”:“2,79”,
“桌面游戏类别”:“21点,所有游戏”
}, {
“标题”:“神奇四侠”,
“图像_180x100”:”https://www.supercasino.com/assets/GB/games/FantasticFour_super_180x100.jpg",
“桌面类别ID”:“3,4,79”,
“桌面游戏类别”:“老虎机、Jackpot、所有游戏”
},
$("#twopopular").append("<li><p>'" + x.title + "'</p></li>");
return x.title.search("Vikingmania");
return elems.length === 1 && elem.nodeType === 1 ?
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>game</title>
<link href="//cdn.rawgit.com/noelboss/featherlight/1.7.5/release/featherlight.min.css" type="text/css" rel="stylesheet" />
<link>
<script src="//code.jquery.com/jquery-latest.js"></script>
<script src="//cdn.rawgit.com/noelboss/featherlight/1.7.5/release/featherlight.min.js" type="text/javascript" charset="utf-8"></script>
<!--<script type="text/javascript" src="foo.js"></script>-->
<style>
li {
float: left;
}
ol {
list-style-type: none;
}
div {
display: none;
}
</style>
</head>
<body>
<h3>Test</h3>
<button type="button" class="btn btn-primary" id="all">All Games</button>
<button type="button" class="btn btn-primary" id="jackpots">Jackpots</button>
<button type="button" class="btn btn-primary" id="popular">Popular Games</button>
<button type="button" class="btn btn-primary" id="slots">Slots</button>
<div id="one">
<ol id="oneall">
<li data-featherlight></li>
</ol>
</div>
<div id="two">
<ol id="twopopular"></ol>
</div>
<script>
var data = {
"items": [{
"title": "Frankie Dettori",
"image_180x100": "https://www.supercasino.com/assets/GB/games/sc_fdt_180x100.jpg",
"desktop_categories_ids": "39,3,79",
"desktop_categories": "Popular Games,Slots,All Games"
}, {
"title": "Frankie Dettori",
"image_180x100": "https://www.supercasino.com/assets/GB/games/sc_fdt_180x100.jpg",
"desktop_categories_ids": "39,3,79",
"desktop_categories": "Popular Games,Slots,All Games"
}, {
"title": "Desert Treasure Desktop",
"image_180x100": "https://www.supercasino.com/assets/GB/games/sc_dt_180x100.jpg",
"desktop_categories_ids": "3,79",
"desktop_categories": "Slots,All Games"
}, {
"title": "Vacation Station",
"image_180x100": "https://www.supercasino.com/assets/GB/games/sc_er_180x100.jpg",
"desktop_categories_ids": "3,79",
"desktop_categories": "Slots,All Games"
}, {
"title": "Vacation Station",
"image_180x100": "https://www.supercasino.com/assets/GB/games/sc_er_180x100.jpg",
"desktop_categories_ids": "3,79",
"desktop_categories": "Slots,All Games"
}, {
"title": "Hulk 25 Line",
"image_180x100": "https://www.supercasino.com/assets/GB/games/Hulk_180x100.jpg",
"desktop_categories_ids": "39,3,4,79",
"desktop_categories": "Popular Games,Slots,Jackpots,All Games"
}, {
"title": "Jackpot Darts",
"image_180x100": "https://www.supercasino.com/assets/GB/games/sc_drts_180x100.jpg",
"desktop_categories_ids": "3,4,79",
"desktop_categories": "Slots,Jackpots,All Games"
}, {
"title": "Genie Hi-Lo",
"image_180x100": "https://www.supercasino.com/assets/GB/games/sc_ghl_180x100.jpg",
"desktop_categories_ids": "79",
"desktop_categories": "All Games"
}, {
"title": "Gladiator",
"image_180x100": "https://www.supercasino.com/assets/GB/games/sc_glr_180x100.jpg",
"desktop_categories_ids": "39,3,79",
"desktop_categories": "Popular Games,Slots,All Games"
}, {
"title": "Mr.Cashback",
"image_180x100": "https://www.supercasino.com/assets/GB/games/sc-mcb-180x100.jpg",
"desktop_categories_ids": "3,79",
"desktop_categories": "Slots,All Games"
}, {
"title": "Great Blue",
"image_180x100": "https://www.supercasino.com/assets/GB/games/sc-bib-180x100.jpg",
"desktop_categories_ids": "39,3,79",
"desktop_categories": "Popular Games,Slots,All Games"
}, {
"title": "Wild Games",
"image_180x100": "https://www.supercasino.com/assets/GB/games/SC_WILDGAMES_180x100.jpg",
"desktop_categories_ids": "3,79",
"desktop_categories": "Slots,All Games"
}, {
"title": "Kong: Eighth Wonder of the World",
"image_180x100": "https://www.supercasino.com/assets/GB/games/SC_Kong_180x100.jpg",
"desktop_categories_ids": "3,79",
"desktop_categories": "Slots,All Games"
}, {
"title": "Iron Man 2 - 25 Line",
"image_180x100": "https://www.supercasino.com/assets/GB/games/Ironman2_180x100.jpg",
"desktop_categories_ids": "3,4,79",
"desktop_categories": "Slots,Jackpots,All Games"
}, {
"title": "Iron Man",
"image_180x100": "https://www.supercasino.com/assets/GB/games/IronMan_180x100.jpg",
"desktop_categories_ids": "3,4,79",
"desktop_categories": "Slots,Jackpots,All Games"
}, {
"title": "UK Blackjack",
"image_180x100": "https://www.supercasino.com/assets/GB/games/sc_bjuk_180x100_v2.jpg",
"desktop_categories_ids": "2,79",
"desktop_categories": "Blackjack,All Games"
}, {
"title": "21 Duel Blackjack",
"image_180x100": "https://www.supercasino.com/assets/GB/games/sc_bj21d_180x100_v2.jpg",
"desktop_categories_ids": "2,79",
"desktop_categories": "Blackjack,All Games"
}, {
"title": "Fantastic Four",
"image_180x100": "https://www.supercasino.com/assets/GB/games/FantasticFour_super_180x100.jpg",
"desktop_categories_ids": "3,4,79",
"desktop_categories": "Slots,Jackpots,All Games"
},
{
"title": "The Mummy",
"image_180x100": "https://www.supercasino.com/assets/GB/games/SC_GAME_MUMMY.jpg",
"desktop_categories_ids": "3,79",
"desktop_categories": "Slots,All Games"
}, {
"title": "Desert Treasure II",
"image_180x100": "https://www.supercasino.com/assets/GB/games/sc-dt2-180x100.jpg",
"desktop_categories_ids": "3,79",
"desktop_categories": "Slots,All Games"
}, {
"title": "X Men",
"image_180x100": "https://www.supercasino.com/assets/GB/games/Xmen_180x100.jpg",
"desktop_categories_ids": "3,4,79",
"desktop_categories": "Slots,Jackpots,All Games"
}, {
"title": "Daredevil",
"image_180x100": "https://www.supercasino.com/assets/GB/games/Daredevil_180x100.jpg",
"desktop_categories_ids": "3,4,79",
"desktop_categories": "Slots,Jackpots,All Games"
}, {
"title": "Rocky",
"image_180x100": "https://www.supercasino.com/assets/GB/games/sc_rky_180x100.jpg",
"desktop_categories_ids": "3,79",
"desktop_categories": "Slots,All Games"
}, {
"title": "Hulk 50 Line",
"image_180x100": "https://www.supercasino.com/assets/GB/games/Hulk50_180x100.jpg",
"desktop_categories_ids": "3,4,79",
"desktop_categories": "Slots,Jackpots,All Games"
}, {
"title": "Football Fans",
"image_180x100": "https://www.supercasino.com/assets/GB/games/SC_GAME_FOOTBALL_FANS.jpg",
"desktop_categories_ids": "3,79",
"desktop_categories": "Slots,All Games"
}, {
"title": "Hot Gems",
"image_180x100": "https://www.supercasino.com/assets/GB/games/SC_GAME_HOT_GEMS.jpg",
"desktop_categories_ids": "3,79",
"desktop_categories": "Slots,All Games"
}, {
"title": "Wings of Gold",
"image_180x100": "https://www.supercasino.com/assets/GB/games/SC_GAME_WINGS_OF_GOLD.jpg",
"desktop_categories_ids": "3,79",
"desktop_categories": "Slots,All Games"
}, {
"title": "Goddess of Life",
"image_180x100": "https://www.supercasino.com/assets/GB/games/SC_GAME_GODDESS_OF_LIFE.jpg",
"desktop_categories_ids": "3,79",
"desktop_categories": "Slots,All Games"
}, {
"title": "Vikingmania",
"image_180x100": "https://www.supercasino.com/assets/GB/games/SC_GAME_VIKING_MANIA.jpg",
"desktop_categories_ids": "3,79",
"desktop_categories": "Slots,All Games"
}, {
"title": "Elektra",
"image_180x100": "https://www.supercasino.com/assets/GB/games/Elektra_180x100.jpg",
"desktop_categories_ids": "3,4,79",
"desktop_categories": "Slots,Jackpots,All Games"
}, {
"title": "Fantastic Four 50 Line",
"image_180x100": "https://www.supercasino.com/assets/GB/games/FantasticFour50_super_180x100.jpg",
"desktop_categories_ids": "39,3,4,79",
"desktop_categories": "Popular Games,Slots,Jackpots,All Games"
}, {
"title": "Iron Man 2 50 Line",
"image_180x100": "https://www.supercasino.com/assets/GB/games/IronMan250_180x100.jpg",
"desktop_categories_ids": "3,4,79",
"desktop_categories": "Slots,Jackpots,All Games"
}, {
"title": "Wild Spirit",
"image_180x100": "https://www.supercasino.com/assets/GB/games/SC_WILDSPIRIT_180x100.jpg",
"desktop_categories_ids": "3,79",
"desktop_categories": "Slots,All Games"
}
]
};
//List all images in the ol #oneall
$.each(data.items, function(i, f) {
$("#oneall").append("<li><img src='" + f.image_180x100 + "' / ></li>");
});
//toggles the div #one with the ol #oneall
$('#all').click(function() {
$("#one").toggle();
});
//filter all title with the value "Vikingmania". This part doesn't work
$.filter(data.items, function(x) { return x.title.search("Vikingmania");
$("#twopopular").append("<li><p>'" + x.title + "'</p></li>");
});
//toggles the div #two with the ol #twopopular
$('#popular').click(function() {
$("#two").toggle();
});
</script>
</body>
</html>