1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
---
title: DOMContentLoaded
slug: Web/API/Window/DOMContentLoaded_event
tags:
- Event
- Reference
- Web
- Window
translation_of: Web/API/Window/DOMContentLoaded_event
original_slug: Web/Events/DOMContentLoaded
---
<div>{{APIRef}}</div>
<p><strong><code>DOMContentLoaded</code></strong> 이벤트는 초기 HTML 문서를 완전히 불러오고 분석했을 때 발생합니다. 스타일 시트, 이미지, 하위 프레임의 로딩은 기다리지 않습니다.</p>
<table class="properties">
<tbody>
<tr>
<th scope="row">확산</th>
<td>예</td>
</tr>
<tr>
<th scope="row">취소 가능</th>
<td>예 (although specified as a simple event that isn't cancelable)</td>
</tr>
<tr>
<th scope="row">인터페이스</th>
<td>{{domxref("Event")}}</td>
</tr>
<tr>
<th scope="row">이벤트 처리기 속성</th>
<td>아니오</td>
</tr>
</tbody>
</table>
<p><code>DOMContentLoaded</code>의 원본 대상은 다 불러온 {{domxref("Document")}}입니다. You can listen for this event on the <code>Window</code> interface to handle it in the capture or bubbling phases. For full details on this event please see the page on the Document: {{domxref("Document/DOMContentLoaded_event", "DOMContentLoaded")}} event.</p>
<p>A different event, {{domxref("Window/load_event", "load")}}, should be used only to detect a fully-loaded page. It is a common mistake to use <code>load</code> where <code>DOMContentLoaded</code> would be more appropriate.</p>
<h2 id="예제">예제</h2>
<h3 id="기본_용도">기본 용도</h3>
<pre class="brush: js notranslate">window.addEventListener('DOMContentLoaded', (event) => {
console.log('DOM fully loaded and parsed');
});
</pre>
<h2 id="사양">사양</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">사양</th>
<th scope="col">상태</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{SpecName('HTML WHATWG', 'indices.html#event-domcontentloaded')}}</td>
<td>{{Spec2('HTML WHATWG')}}</td>
</tr>
</tbody>
</table>
<h2 id="브라우저_호환성">브라우저 호환성</h2>
<p>{{Compat("api.Window.DOMContentLoaded_event")}}</p>
<h2 id="같이_보기">같이 보기</h2>
<ul>
<li>Related events: {{domxref("Window/load_event", "load")}}, {{domxref("Document/readystatechange_event", "readystatechange")}}, {{domxref("Window/beforeunload_event", "beforeunload")}}, {{domxref("Window/unload_event", "unload")}}</li>
<li>This event on {{domxref("Document")}} targets: {{domxref("Document/DOMContentLoaded_event", "DOMContentLoaded")}}</li>
</ul>
|