You could pass the changed element as additional arguments to the event,
so you just update those, something like this:
// jquery.myPlugin.js
$(window).bind('myPluginReload', function(event, changedElement) {
$(find stuff, changedElement).myPlugin({do: things});
});
// Content being
Hey, Nedjo. Good to see you on this side of the Drupal/jQuery
fence. :-) I like Felix's suggestion in this case.
In the near future there will be a dead-tree reference for jQuery on
the shelves. A short excerpt from the first draft should prove
applicable to this conversation:
Another solution that I've found really handy is to have your event code
included with the html.
So, as in my first example, I might have a php class that generates a
datagrid - both the html AND the javascript with event handlers etc. So the
handlers are bound on initial page load, and then
Here's another thought too...
What about having a plugin export a custom event, then when dynamic content
is loaded that uses that plugin it just triggers that event.
For example:
// jquery.myPlugin.js
$(window).bind('myPluginReload', function() {
$(find stuff).myPlugin({do: things});
});
Jonathan Sharp schrieb:
Here's another thought too...
What about having a plugin export a custom event, then when dynamic
content is loaded that uses that plugin it just triggers that event.
For example:
// jquery.myPlugin.js
$(window).bind('myPluginReload', function() {