Possible Duplicate:
How does Stack Overflow notify of server-side events without a page reload? I see no request in Firebug
is there any way to alert the user so that they can perform a reload if there are changes on the page?
<script type="text/javascript">
var page = 'data/apps/<? echo $_SESSION['name']; ?><? echo $_SESSION['last'];>App.html', lM;
function checkModified() {
$.get(page, function(a, b, x) {
var mod = (x.getResponseHeader('Last-Modified')) ? x.getResponseHeader('Last-Modified') : x.getResponseHeader('Content-Length');
if (lM != mod) {
lM = mod;
console.log('Fetched');
alert
("Changes on "+<? echo $_SESSION['name']; ?><? echo $_SESSION['last']; ?>+"App.html has been made");
}
});
}
setInterval(checkModified, 5000); // every 5 seconds
</script>
both pages are located inside one domain.