Created
September 11, 2014 13:01
-
-
Save thotbox/53265053d0120467d532 to your computer and use it in GitHub Desktop.
Ping Pong Compare Timestamps
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Ping Pong Compare Timestamps | |
setInterval(function () { | |
fetchEditDate('/fetch/edit-date/{segment_2}'); | |
var origEditDate = $('#original-edit-date-field').val(); | |
var fetchedEditDate = $('#fetched-edit-date-field').val(); | |
if (fetchedEditDate > origEditDate){ | |
location.reload(); | |
} | |
},500); | |
function fetchEditDate(page_url){ | |
$.ajax({ | |
url:page_url, | |
success:function(data){ | |
$('#fetched-edit-date').html(data); | |
$('#fetched-edit-date-field').val(data); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment