Number.prototype.currency = function() { return '$' + this.toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,') }; function seconds_to_time(s) { var duration = moment.duration(s, 'seconds'); return duration.format("DD-hh:mm"); } function ts_to_remaining(ts) { return moment.unix(ts).fromNow(); } function log() { console.log('LOG >>>', arguments); } function get_items() { fetch('db.json') .then(function(response) { return response.json(); }) .then(function(myJson) { app.items = myJson; }); } var app = new Vue({ el: '#app', data: { title: "egunner", items: [], debug: false }, mounted: function () { // hide splash var splash = document.getElementById("splash"); splash.style.display = "none"; // unhide main container after mount this.$el.style.display = "block"; }, computed: { }, methods: { }, watch: { }, }); get_items(); window.setInterval(function(){ console.log('refresh'); get_items(); }, 5000);