Been googling and looking for an answer to this / best practice.
Let's say you have most of your javascript inside $(document).ready()
for whatever reason, and inside there you have a function that you want to "fire" based on some external javascript function..
What would be the best way to do that? Simply moving the function to the global space isn't entirely a feasible option due to all the variables and stuff inside $(document).ready()
So in this example, there's external javascript that does an ajax request, so when the request is completed, data get's loaded on the page, and then I want to somehow be able to fire that function inside $(document).ready()
when that external javascript ajax completes, but I can't simply call that function due to it not being in the global space.