Menu
Hi there,
In a nutshell, my question is quite simple:
>
How to translate the triggering of a custom event with some bespoke data from jQuery to vanilla JavaScript?
Here is a small function, that used to work immaculately with jQuery:
“`
function _trigger(t, e){ //trigger a custom event
e = e ? e : RQ(“e”); //if event data not passed, then use existing internal event data
jQuery(window).trigger(“pronto.” + t, e); //always prepend “pronto.” and pass the bespoke data in the second variable
}
(I have researched this on the web a lot, but the results were a bit confusing. There seem to be several approaches)
Thanks in advance!