Last active
December 17, 2015 18:18
-
-
Save jakl/5651676 to your computer and use it in GitHub Desktop.
citation hackathon
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<head> | |
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet"> | |
</head> | |
<body> | |
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script> | |
<script src="http://code.jquery.com/jquery-2.0.1.min.js"></script> | |
<script src="index.js"></script> | |
<div id="citations"></div> | |
</body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var params = { | |
book: "bible", | |
citation: "Gen. 1:1" | |
}; | |
url = "http://cskit-server.herokuapp.com/v1/lesson/text.json?callback=?&"; | |
url += "payload=[%7B%22section%22:1,%22readings%22:%7B%22{{book}}%22:[%22{{citation}}%22]%7D%7D]"; | |
//Use mustache here once it works... | |
url = url.replace('{{book}}', params.book); | |
url = url.replace('{{citation}}', params.citation); | |
$.getJSON(url).done(function(data){ | |
console.log(data); | |
$('#citations').text(data); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment