0

Im getting a row count from Mysql using php and i have a jquery refresh which loads the rowcount into the div and displays it. this works great!

Now i need to send an alert if the div's value changes. Ive tried the code below, but it doesnt detect any changes with the div. Any ideas?

var auto_refresh = setInterval(
function ()
{
    $('#load_tweets').load('<?php echo base_url(); ?>index.php/login/count_users/');
}, 1000);

$('#load_tweets').change( function() {
notify('NEW JOB');
});
adam Kearsley
  • 951
  • 2
  • 13
  • 23

1 Answers1

0

The jQuery .change() method works only for form fields.

You can look at below answer on SO for alternative :

jQuery watch div

Community
  • 1
  • 1
metalfight - user868766
  • 2,722
  • 1
  • 16
  • 20