Created
September 8, 2011 19:29
-
-
Save henriquegogo/1204437 to your computer and use it in GitHub Desktop.
jQuery plugin to identify an element content chenge
This file contains hidden or 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
$.fn.extend({ | |
whenNotEmpty: function (callback) { | |
var element = $(this); | |
var loadListen = setInterval(function () { | |
var conteudoLength = $.trim(element.html()).length; | |
if (conteudoLength > 0) { | |
clearInterval(loadListen) | |
if (callback) { callback(); }; | |
}; | |
}, 100); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Good to run a callback after ajax request.