diff --git a/reloadr.js b/reloadr.js index 659f3aa..2f07073 100644 --- a/reloadr.js +++ b/reloadr.js @@ -20,7 +20,7 @@ TO USE: include reloadr.js and tell it what to check: '/css/layout.css' ]); */ - +var continue_poll = true; var Reloadr = { options: { frequency: 2000, @@ -69,11 +69,15 @@ var Reloadr = { // check 'em for (i in urls) this.ajax.call(this, urls[i], function() { - if (this > Date.parse(window._Reloadr_LoadTime)) + if (this > Date.parse(window._Reloadr_LoadTime)) { + continue_poll = false; location.reload(); + } }); - this.go(); + if (continue_poll) { + this.go(); + } }, init: function(options) { window._Reloadr_LoadTime = new Date();