如果舊內容和新內容不相同,我將如何去更新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
哎呀,謝謝。 –
謝謝先生:-)。 –