Just curious, I have this function:
function detectChanges()
{
sendAjax('reload', num_rows, '',
function(data)
{
$('#container').html(data);
});
}
Write it:
detectChanges();
Should I just use setInterval to repeat this function every 5 seconds or is there a better, cleaner jQuery alternative?
It’s not clear what you’re trying to do, but you probably don’t want to be polling something every 5 seconds, ESPECIALLY if you’re going to make an AJAX call to the server every 5 seconds.
Perhaps you can use
jQuery.change()– http://api.jquery.com/change/