request = new XMLHttpRequest request.open 'GET', 'https://zeus.ugent.be/game/top4/show.json', true request.onload = -> if request.status >= 200 and request.status < 400 # Success! data = JSON.parse(request.responseText) str = "" for x in data str += """ """ str += "
#{x.github_name} #{x.score}
" el = document.getElementById('gamification-coders') el.innerHTML = str else # We reached our target server, but it returned an error return request.onerror = -> # There was a connection error of some sort return request.send()