I have an external javascript file that I only want to be included on a particular component, so I am loading it dynamically. This answer describes how to do that.
However, the javscript file I'm using does some stuff on window.load:
$(window).on('load', function() {
//Some logic
});
Because I'm loading this script dynamically for a specific component, this logic is never firing because the load event fired long before the script was loaded. How can I execute this logic after I've loaded the script?