auto reloader

This commit is contained in:
Michael Teeuw
2014-02-19 17:02:17 +01:00
parent cfff71a936
commit 657eb061cd
3 changed files with 43 additions and 1 deletions

View File

@@ -24,6 +24,23 @@ jQuery(document).ready(function($) {
var news = [];
var newsIndex = 0;
(function checkVersion()
{
$.getJSON('githash.php', {}, function(json, textStatus) {
if (json) {
if (json.gitHash != gitHash) {
console.log('refresh');
location.reload();
} else {
console.log('up to date');
}
}
});
setTimeout(function() {
checkVersion();
}, 3000);
})();
(function updateTime()
{
var now = new Date();
@@ -95,7 +112,6 @@ jQuery(document).ready(function($) {
}, 60000);
})();
(function fetchNews() {
$.feedToJson({
feed:'http://feeds.nos.nl/nosjournaal?format=rss',