I am trying to run a jQuery snippet after I initialize a custom jQuery plugin.
The snippet needs to modify part of the DOM that the plugin makes, so I need to ensure that the snippet executes after the plugin finishes initializing its DOM.
$(function() {
// initializing the plugin
PluginConstructor({
"id": "plugin-container"
});
// snippet
$('.some-div-inside-plugin-container').remove();
});
The above seems to execute non-sequentially, top to bottom, since the snippet has no effect, leading me to believe the snippet was executed before the plugin's DOM has finished initializing.
Is there a jQuery/javascript method that allows the snippet to wait for the completion of the plugin?
I cannot modify the source code of the plugin, by the way.
$('selector').on('plugin:ready')