screw jquery

This commit is contained in:
Lorin Werthen 2018-07-11 00:36:43 +02:00
parent d9e060e25c
commit 1f67ea6ea9
No known key found for this signature in database
GPG key ID: F11FFC921E0E08E0
2 changed files with 27 additions and 11 deletions

View file

@ -1,4 +1,11 @@
$.getJSON 'https://zeus.ugent.be/game/top4/show.json', (data) -> 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 = "<table>" str = "<table>"
for x in data for x in data
str += """ str += """
@ -16,4 +23,14 @@
""" """
str += "</table>" str += "</table>"
$('#gamification-coders').html(str) 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()

View file

@ -5,7 +5,6 @@
<% end %> <% end %>
<% content_for :scripts do %> <% content_for :scripts do %>
<script src="https://code.jquery.com/jquery-3.0.0.min.js" charset="utf-8"></script>
<%= asset :js, :gamification %> <%= asset :js, :gamification %>
<% end %> <% end %>