如果旧内容和新内容不相同,我将如何去更新divs内容。只有在相同时才更新。如在,让我们说。目前我有这个:jQuery,加载前比较内容
<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));
有没有什么办法让它首先检查内容?在更新之前?
!===是这样吗? – Dev
哎呀,谢谢。 –
谢谢先生:-)。 –