From da78a9e329e272dedb2400b79a3bdeebff387d47 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:17 -0500 Subject: initial commit --- .../api/document/readystatechange_event/index.html | 139 +++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 files/ko/web/api/document/readystatechange_event/index.html (limited to 'files/ko/web/api/document/readystatechange_event/index.html') diff --git a/files/ko/web/api/document/readystatechange_event/index.html b/files/ko/web/api/document/readystatechange_event/index.html new file mode 100644 index 0000000000..3286bb4727 --- /dev/null +++ b/files/ko/web/api/document/readystatechange_event/index.html @@ -0,0 +1,139 @@ +--- +title: 'Document: readystatechange event' +slug: Web/API/Document/readystatechange_event +translation_of: Web/API/Document/readystatechange_event +--- +
{{APIRef}}
+ +

readystatechange 이벤트는 현재 페이지의 {{domxref("Document.readyState", "readyState")}}  속성값이 변할 때 발생한다.

+ + + + + + + + + + + + + + + + + + + + +
BubblesNo
CancelableNo
Interface{{domxref("Event")}}
Event handler propertyonreadystatechange
+ +

Examples

+ +

Live example

+ +

HTML

+ +
<div class="controls">
+  <button id="reload" type="button">Reload</button>
+</div>
+
+<div class="event-log">
+  <label>Event log:</label>
+  <textarea readonly class="event-log-contents" rows="8" cols="30"></textarea>
+</div>
+ + + +

JS

+ +
const log = document.querySelector('.event-log-contents');
+const reload = document.querySelector('#reload');
+
+reload.addEventListener('click', () => {
+  log.textContent ='';
+  window.setTimeout(() => {
+      window.location.reload(true);
+  }, 200);
+});
+
+window.addEventListener('load', (event) => {
+    log.textContent = log.textContent + 'load\n';
+});
+
+document.addEventListener('readystatechange', (event) => {
+    log.textContent = log.textContent + `readystate: ${document.readyState}\n`;
+});
+
+document.addEventListener('DOMContentLoaded', (event) => {
+    log.textContent = log.textContent + `DOMContentLoaded\n`;
+});
+
+
+ +

Result

+ +

{{ EmbedLiveSample('Live_example', '100%', '160px') }}

+ +

Specifications

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName("HTML WHATWG", "indices.html#event-readystatechange", "readystatechange")}}{{Spec2("HTML WHATWG")}}
+ +

Browser compatibility

+ + + +

{{Compat("api.Document.readystatechange_event")}}

+ +

See also

+ + -- cgit v1.2.3-54-g00ecf