1
jQuery : 페이지 하단에 외부 JS 인 경우 document.ready를 사용하는 이유는 무엇입니까?
페이지 맨 아래에로드되는 외부 파일로 모든 JS를 포함하고 있습니다. 이 파일에는 다음과 같이 정의 된 몇 가지 메서드가 있으며 ready 이벤트에서 호출합니다. var SomeNamepsace = {}; SomeNamepsace.firstMethod = function () { // do something }; SomeNamepsace.secondMethod = function () { // do something else }; $(document).ready(function () { SomeNamepsace.firstMethod(); SomeNamepsace.secondMethod(); …
88
javascript
jquery
html