Detecting Change jQuery
<p>So I have this notification system that uses jQuery and PHP. The jQuery checks the PHP script every few seconds, and if there is a change, it is displayed. I want to know how to detect a change in the data (like from '1' to '2') and then responding by causing the object to animate (using this: $(this).effect("shake", { times:3 }, 300);). How can I do this?</p>

<p><strong>jQuery</strong></p>

<pre><code>$(document).ready(function()
{
$.get('/codes/php/nf.php', function(data
{
$('#badge').badger(data);});});
setInterval(function(){
$.get('/codes/php/nf.php', function(data) 
{
$('#badge').badger(data);});}, 8000);
</code></pre>
