How would I go around updating a divs content, if the old content and the new content aren’t the same. Only update if it’s the same. As in, let’s say. Currently I have this:
<div style="min-height:200px;max-height:220px;height:auto;overflow-y:auto;padding:2px;" class="main">
<?php include("ajax/display_messages.php");?>
</div>
$(setInterval(function() {
$('.main').load('ajax/display_messages.php',
function(response, status, xhr){ });
}, 2000));
Is there any way to make it check the contents first? Before updating it?
Use
$.get()instead of.load().