I’m trying to make some Drupal 7 content updated by jQuery’s load() and it’s not being processed by the relevant JS code. The code in question uses bind() and is spread over dozens of Drupal core JS files.
I want to workaround this by using jQuery 1.7.1 and changing
bind: function( types, data, fn ) {
return this.on( types, null, data, fn );
},
to behave as
delegate: function( selector, types, data, fn ) {
return this.on( types, selector, data, fn );
},
The only thing missing is selector as you can see. Can I somehow get it from the standard bind() calls?
You could try something like
as every jQuery object holds the current selectors and context elements as properties.
However, you should not apply that workaround by overwriting
.bindwith thedelegatefuncionality, it will only introduce bugs into your application. Better change your code which invokes bind but shouldn’t.