Internal Functionality Events
I was thinking it would be a good idea if you could bind events to the internal jQuery functionality. So I'm planning on making a plugin out of this idea. So I would like your opinions on this if there is anyone that tried this before. Any comments about potential benefits, pitfalls, possible additions... are welcome.
This is an example of how a binding would work:
- function test() {
-
-
-
-
-
- console.log('Test executed!');
- }
- var fn = jQuery.prototype.append;
- jQuery.prototype.append = function() {
- fn.apply( this, arguments );
- this.trigger('contentChanged.jQInternals');
- };
- $('body').bind('contentChanged.jQInternals', test);
- $('body').append('FOO!');
jsFiddle link