Created
March 23, 2014 12:37
-
-
Save fatihky/9722537 to your computer and use it in GitHub Desktop.
jQuery watch div
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function watch(selector, ms, cb) | |
{ | |
var last_val = $(selector).html(); | |
var interval = setInterval(function(){ | |
var curr_val = $(selector).html(); | |
if(curr_val != last_val) | |
{ | |
last_val = curr_val; | |
if(cb) cb(); | |
} | |
}, ms); | |
return interval; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment