I load in a div like this :
var auto_refresh = setInterval(
function ()
{
$('#nowplaying').load('nowplaying.php').fadeIn("slow");
}, 10000);
I’d like to load only if there’s a change in the page.
How could I do that with ‘change’ ?
Here’s what I’ve tried :
function ()
{
var cachedDOM = $('div#nowplaying').html();
$.get('nowplaying.php',function(data){
if (cachedDOM != data) {
$('#nowplaying').load('nowplaying.php').fadeIn("slow");
}
}
)
}, 3000);
The problem is that “cachedDOM != data” is always true.
Patrick
So you need another page let you know whether it changes.