Skip to content
This repository was archived by the owner on May 15, 2019. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions reloadr.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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();
Expand Down