--- title: load slug: Web/API/Window/load_event tags: - Event - 이벤트 translation_of: Web/API/Window/load_event original_slug: Web/Events/load ---
load 이벤트는 리소스와 그것에 의존하는 리소스들의 로딩이 완료되면 실행됩니다.
<script>
window.addEventListener("load", function(event) {
console.log("All resources finished loading!");
});
</script>
script 엘리먼트<script>
var script = document.createElement("script");
script.addEventListener("load", function(event) {
console.log("Script finished loading and executing");
});
script.src = "http://example.com/example.js";
script.async = true;
document.getElementsByTagName("script")[0].parentNode.appendChild(script);
</script>
| 속성 | 타입 | 설명 |
|---|---|---|
target {{readonlyInline}} |
{{domxref("EventTarget")}} |
The event target (the topmost target in the DOM tree). |
type {{readonlyInline}} |
{{domxref("DOMString")}} |
The type of event. |
bubbles {{readonlyInline}} |
{{domxref("Boolean")}} |
Whether the event normally bubbles or not. |
cancelable {{readonlyInline}} |
{{domxref("Boolean")}} |
Whether the event is cancellable or not. |
view {{readonlyInline}} |
{{domxref("WindowProxy")}} |
{{domxref("Document.defaultView", "document.defaultView")}} (window of the document) |
detail {{readonlyInline}} |
long (float) |
0. |
| 스펙 | 상태 | 코멘트 |
|---|---|---|
| {{SpecName('UI Events', '#event-type-load', 'load')}} | {{Spec2('UI Events')}} | |
| {{SpecName('HTML WHATWG', 'parsing.html#the-end:event-load', 'Load event')}} | {{Spec2('HTML WHATWG')}} |
이것은 문서 로딩이 끝날때 수행되는 단계와 연결되는 섹션과 연결됩니다. 'load' 이벤트는 많은 엘리먼트들에서도 발생합니다. 그리고 스펙 문서에서는 많은 곳에서 "load이벤트를 지연할 수 있는" 것들을 언급한다는 것을 주의하십시오. |