Implement JQuery polling of user balance on page
This commit is contained in:
14
static/js/balance-poll.js
Normal file
14
static/js/balance-poll.js
Normal file
@@ -0,0 +1,14 @@
|
||||
function updateBalance() {
|
||||
$.get("/api/balance", function(data) {
|
||||
$("#balance-display").html(data['balance']);
|
||||
});
|
||||
}
|
||||
|
||||
function pollBalance() {
|
||||
updateBalance();
|
||||
window.setTimeout(pollBalance, 1000);
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
pollBalance();
|
||||
});
|
||||
9266
static/js/jquery.js
vendored
Normal file
9266
static/js/jquery.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user