I want to execute a piece of code that only runs if the document has already been loaded (not something that executes RIGHT after it's loaded). Looking for something that's not JQuery.
The premise behind the question: I have a function that runs before the page is fully loaded. However, that function calls another function that dispatches an event. I only want that event to be dispatched if the window is already loaded. If not, maybe just store it in an array and dispatch it once the page has loaded