I have functions in a file that is being loaded first, that is calling other functions that exist on a file that is being loaded after. I am getting an error when theses functions are loaded that reads “Is not a function” and rightfully so. My question, is there a way to delay said functions to wait till the other file is loaded before calling?
I was going to use the below, however how do you name this function?
There are multiple ways to do what you’re asking. Do you want an event handler?
From what I understand, .$getScript can use a callback (which looks to be what you’re doing); so you can use just a callback function. instead. A callback function can be set to run after the other scripts have completely loaded.
If you want to stick with the $.getScript, you can try this: