$(document).ready(function(){}); vanilla JS로 대체 DOMContentLoaded
https://euntori7.tistory.com/356
document ready 를 순수 javascript로
jquery를 쓰지 않고 순수 javascript로 ready()를 대체하는 코드. 참고로, $(docum..
euntori7.tistory.com
https://developer.mozilla.org/ko/docs/Web/Events/DOMContentLoaded
DOMContentLoaded
DOMContentLoaded 이벤트는 초기 HTML 문서를 완전히 불러오고 분석했을 때 발생합니다. 스타일 시트, 이미지, 하위 프레임의 로딩은 기다리지 않습니다.
developer.mozilla.org
document.addEventListener('DOMContentLoaded', function(){ ... });
Cross-browser Document Ready with Vanilla JavaScript
https://www.competa.com/blog/cross-browser-document-ready-with-vanilla-javascript/
Cross-browser Document Ready with Vanilla JavaScript - Competa
In jQuery, developers are used to the $(document).ready(); function. This is just a check if your document is completely loaded, and all needed stuff is on your page. But since I left jQuery in my work, I wanted to have the same check but with Vanilla Java
www.competa.com