I have a pretty simple problem that I need help with.
I have two js files that I uploaded to a page via a tag in html. All code in both of these files is executed / loaded within $(document).ready();
In a specific event, function A, defined in the first file, tries to call function B, defined in another file. However, this fails, I get an error that function B is not defined.
I notice that if I take the definition of function B outside of $(document).ready() , this function A will be able to call function B - it is in scope.
Why?
source share