Skip to content

Commit c2c6d11

Browse files
author
Philippe BARBOSA
committed
randomize list display
1 parent bfb9c97 commit c2c6d11

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

index.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,15 @@ <h1>The best free Python resources</h1>
6060
<script src="./js/mustache.js"></script>
6161

6262
<script type="text/javascript">
63+
64+
function randOrd(){
65+
return (Math.round(Math.random())-0.5);
66+
}
67+
6368
$(document).ready(function() {
6469
$.getJSON('./issues.json?' + Math.random(), function(data) {
6570
var template = $('#booktpl').html();
71+
data.books.sort(randOrd);
6672
var html = Mustache.to_html(template, data);
6773
$('#issueswrap').html(html);
6874
});

0 commit comments

Comments
 (0)