$(document).ready(function(){ window.boards = new Array(); function handle_boards(data) { $.each(data, function(k, v) { if (v.uri != 'meta' && v.uri != 'b') { boards.push(''+v.uri+''); } }) if (boards[0]) { $('.sub[data-description="2"]').after(' [ '+boards.slice(0,15).join(" / ")+' ] '); } } $.getJSON("/boards-top20.json", handle_boards) });