Skip to content

Instantly share code, notes, and snippets.

@lpellegr
Last active August 18, 2016 19:57
Show Gist options
  • Save lpellegr/999deea9f5761c57fa26cd4d4550a249 to your computer and use it in GitHub Desktop.
Save lpellegr/999deea9f5761c57fa26cd4d4550a249 to your computer and use it in GitHub Desktop.
Demonstrate how to list Github repository tags dynamically using Github API
<script src="https://code.jquery.com/jquery-3.1.0.min.js"></script>
<script type="text/javascript">
$(document).ready (function () {
jQuery.getJSON("https://api.github.com/repos/ow2-proactive/scheduling/tags").done(function (data) {
for(var i = 0; i < data.length; i++) {
var item = $("<li>");
var tag = data[i].name;
var a = $("<a>").attr("href", "http://doc.activeeon.com/" + tag).text("Version " + tag);
item.append(a);
$("#versions").append(item);
}
})
});
</script>
<ul id="versions" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment