I need to call a function after a DIV has been removed from the page.
I have tried adding a callback like so, but no luck. Any suggestions?
$(foo).remove( function() {
   stepb();
});
                Try this
$.when($('#foo').remove()).then(stepb());
[Example1][1] and [Example2][2].
$('#foo').remove();
stepb();
Since the remove method in jQuery is synchronous, stepb() will be invoked after remove() has finished. So, no need to use $.when().then().
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With