Answer the question
In order to leave comments, you need to log in
Why does it give an error when trying to call a function from another script?
Decided to output the function to another .js file ('script2.js').
When calling a function from 'script.js', it throws an error.
Explain how the browser combines all these js nicknames into one. And how to get rid of this problem?
If anything, the file with the function is connected earlier (!) than the file where this function is called.
Answer the question
In order to leave comments, you need to log in
in different scopes
Move the function from $().ready() to the global scope.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question