Take the 2-minute tour ×  Ok, I'm having a slight bit of
confusion writing my own jQuery UI widget plugins. The problem
lies in the destroy function. In the docs, it says to put the
default destroy first then write other things particular to the
widget after it.  // now do other stuff particular to this
widget  See http://jqueryui.com/docs/Developer_Guide  However in
their example scripts (those being the actual pluings for jQuery
Ui released code, does it the opposite. The
$.Widget.prototype.destroy.apply(this, arguments);  is at the
end of the function. See http://dev.jqueryui.com/browser/trunk/u
i/jquery.ui.progressbar.js (and all of the other built in
widgets as well)  So which is it? The way the current widgets
are written, or by the explanation in the code comment in the
Developer_Guide?  share|improve this question  1 Answer 1  up
vote 1 down vote accepted  I would personally put it at the end,
in case anything crazy happens, but make sure anything you've
created gets destroyed, then let the base metho