I would like to execute a callback after a particular div gets removed. I tried this, but it does not work:
$('div.myclass').remove(function(){
alert ("div removed");
});
Anyone know how to execute such a callback? I checked the jQuery documentation for remove(), but it does not mention anything about callbacks. Does this mean remove() does not support a callback?
UPDATE: Here is a more detailed explanation of what I am trying to accomplish. I have a div with class 'nojavascript'. I want to display this div only if the user does not have javascript enabled. Here is the code:
$(document).ready(function() {
$('div.nojavascript').remove();
... // additional jquery commands
});
The problem: this div is sometimes displayed to the user for a brief moment, even though javascript is enabled. It's as though the page is displayed to the user before .remove() finishes executing. I am trying to ensure that the user never sees this div, even for a brief moment, if javascript is enabled.