In a pure JS environment without jQuery, addEventListener() is used to register events instead of e.g. the old jQuery on().
One disadvantage of addEventListener() is that it does not deduplicate registration of pairs of event and event handler and therefore these can pile up in an unwanted way especially in an Ajax environment.
So, in order to at least deduplicate their registration, we've introduced a new convenience function for the user:
function _won(a, b, c = false) { if(c === false) c = {once: true}; setTimeout( () => window.addEventListener(a, b, c) ); };
In a pure JS environment without jQuery,
addEventListener()
is used to register events instead of e.g. the old jQueryon()
. One disadvantage ofaddEventListener()
is that it does not deduplicate registration of pairs of event and event handler and therefore these can pile up in an unwanted way especially in an Ajax environment.So, in order to at least deduplicate their registration, we've introduced a new convenience function for the user:
...which can be called e.g. like this:
For extensive documentation, please see the Events page on 4nf.org.