Reputation: 2909
I read different answers on stackoverflow on how can I destroy a wigdet/jQueryObject and unbind all events on it.
And here is what I came up with.
$('selector').remove().off().find("*").off();
$('selector').off().remove().find("*").off();
Question:
My question is regarding the performance of above 2.
Will there be a performance difference by changing the order.
Is there a difference between using off()
after remove()
or before remove()
?
Or is it the same and the order is not important, performance wise?
Update :
also what about Empty
$('selector').empty().off().find("*").off();
$('selector').off().empty().find("*").off();
Upvotes: 0
Views: 317