id,summary,reporter,owner,description,type,status,priority,component,severity,resolution,keywords,cc,release 13509,"jquery error around ""unload"" function",clemens,clemens,"The DataSaverPlugin (revision r15561) does not work with modern jquery versions. It produces the following Javascript error `$(...).unload is not a function`. Running Trac 1.2.2, with Windows Firefox 63. It looks like the problem is usage of the !deprecated `unload` function in the `datasaver` JS routine: {{{ $(window).unload(datasaver_savior) // DEPRECATED }}} The following the a proper replacement {{{ $(window).on(""unload"",datasaver_savior) }}} This is what I learned from Denys Séguret at [https://stackoverflow.com/questions/44107102/uncaught-typeerror-b-unload-is-not-a-function-in-jquery-3-2-1 stackoverflow]: > This function was first !deprecated in 1.8 and then removed. > You could in theory replace it with > `.on(""unload"", function(){` > which it was a shortcut for. > \\ > But it was removed for a good reason: listening for this event is usually a bad practice. The truth is there's no real cross-browser and reliable solution to handle page termination. The real solution is to avoid relying on this event. You must design your application so that you don't have anything to do on page closing. ",defect,closed,normal,DataSaverPlugin,blocker,fixed,,,1.2