Number.prototype.currency = function() { return '$' + this.toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,') }; function log() { console.log('LOG >>>', arguments); } function get_items() { var xhr = new XMLHttpRequest(); xhr.onload = function() { var data = {}; try { data = JSON.parse(xhr.responseText); } catch(e){ log('could not parse JSON'); } app.items = data; }; xhr.open('GET', 'db.json', true); try { xhr.send(); } catch(e) { log('err', e); } } 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);