replaced quote.coffee with quote.js

This commit is contained in:
fklinck 2018-12-19 22:22:49 +01:00
parent b7cb6f2591
commit 092c54ab0c
2 changed files with 7 additions and 4 deletions

View file

@ -1,4 +0,0 @@
$ ->
$.getJSON './quotes.json', (data) ->
quote = data[Math.floor(Math.random()*data.length)]
$('#quote').append("<h3>#{quote.title}</h3><p>#{quote.description}</p>")

View file

@ -0,0 +1,7 @@
$(function() {
return $.getJSON('./quotes.json', function(data) {
var quote;
quote = data[Math.floor(Math.random() * data.length)];
return $('#quote').append("<h3>" + quote.title + "</h3><p>" + quote.description + "</p>");
});
});