admin管理员组

文章数量:1399936

When I attach functionality to an element do I need to call .widgetName('destroy') before removing it from the DOM or does jQuery handle this?

When I attach functionality to an element do I need to call .widgetName('destroy') before removing it from the DOM or does jQuery handle this?

Share Improve this question edited Dec 28, 2017 at 7:27 Rahul Gupta 10.2k7 gold badges64 silver badges69 bronze badges asked Nov 14, 2008 at 15:19 bradbrad 75.5k21 gold badges74 silver badges85 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 4

Try using remove .

I don't think this happens automatically, but then again, I don't think you need to call the destroy method as the event handlers are destroyed for you from the remove call.

本文标签: javascriptjQuery UIwhen should I use destroy method on the widgetsStack Overflow