screw jquery
This commit is contained in:
parent
d9e060e25c
commit
1f67ea6ea9
2 changed files with 27 additions and 11 deletions
|
@ -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>"
|
||||
for x in data
|
||||
str += """
|
||||
|
@ -16,4 +23,14 @@
|
|||
"""
|
||||
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()
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
<% end %>
|
||||
|
||||
<% content_for :scripts do %>
|
||||
<script src="https://code.jquery.com/jquery-3.0.0.min.js" charset="utf-8"></script>
|
||||
<%= asset :js, :gamification %>
|
||||
<% end %>
|
||||
|
||||
|
|
Loading…
Reference in a new issue