I found code in my codebase that has $(document).ready(function() {...}
inside of another $(document).ready(function() {...}
e.g.
$(document).ready(function() {
// 20 lines...
$(document).ready(function() {
foo()
}
// 200 lines...
}
function foo() {...}
I want to understand the order of execution so I can safely refactor out this nested callback. The outer callback seems to continue executing before the inner callback executes. Is the outer callback guaranteed to finish before the inner callback gets called?