Why is a function declared in document.ready() not defined when called?

后端 未结 5 1941
逝去的感伤
逝去的感伤 2021-01-15 17:52

Here is my HTML/JavaScript:



        
5条回答
  •  耶瑟儿~
    2021-01-15 18:36

    Variables and methods declared inside the $(function() function are only accessible within that. If you need to use those outside, you you make it in the global namespace like

    window.functionName = functionName;
    

提交回复
热议问题