$(document).ready(function(){ $.getJSON("_site/examples.json") .done(function(data) { var i = 0; var t = 0; var len = 0; var node = ''; var laser = ''; var directories = Object.keys(data); directories.splice(directories.indexOf('basics'), 1); directories.splice(directories.indexOf('games'), 1); directories.unshift('basics', 'games'); directories.forEach(function(dir) { var files = data[dir]; len = Math.floor(files.length / 4) + 1; if ((files.length / 4) % 1 == 0) { len--; } if (len > 9) { laser = 'laser10'; } else { laser = 'laser' + len; } if (i == 1) { node = '
' + dir + '
'; node += '' + files.length + ' examples
Error!
'; node += ':(
Unable to load examples.json data file
'; node += 'Did you open this html file locally?
'; node += 'It needs to be opened via a web server, or due to browser security permissions
it will be unable to load local resources such as images and json data.
Please see our Getting Started guide for details.
'; node += '