help desk
if you add a listener on a global level, don't forget to "off" it, otherwise the memory on the FE will grow until a complete reload of the page is done.
if you add a listener on a global level, don't forget to "off" it, otherwise the memory on the FE will grow until a complete reload of the page is done.
AVOID DOING
// Widget/spa page template function init(){ [...] $("body").on("click", ...) [...] }
DO INSTEAD
// Widget/spa page template function init(){ [...] $("body").off("click.unique_namespace").on("click.unique_namespace", ...) [...] }
where "unique_namespace" should be unique in the app. I suggest you use the code of your widget/spa page
Répondu le : 2022-12-06 10:35:00