I'm loading some content inside a div with setInterval
, and I don't want it to run everytime so I need to check if the content has changed from the last time it ran.
Here's what I'm currently using that's not working
var auto_refresh = setInterval(
function() {
$('#loaddiv').load('/wzha/reload.php');
$('#loaddiv').change(function() {
var dddd = $('#loaddiv').text();
alert(dddd);
});
}, 1000);
Example:
reload.php is just <?php echo 'something here'; ?>
. When I save reload.php, it needs to put something here
in to the #loaddiv
. It should not load the div anymore until I re-save reload.php to something else.