Jquery function is not working due to $(document).ready

前端 未结 4 457
花落未央
花落未央 2021-01-22 18:48

we have two js fie , test-1.js , test-2.js.




        
4条回答
  •  囚心锁ツ
    2021-01-22 18:57

    If you want to use code from test-1.js in test-2.js you have to load test-1.js first. JavaScript executes sequentially for synchronous code. So you can not access code from another scope (e.g. a file) if that code has not already been executed.

提交回复
热议问题