--- title: readystatechange slug: Web/API/Document/readystatechange_event translation_of: Web/API/Document/readystatechange_event original_slug: Web/Events/readystatechange ---
{{ApiRef}}
L'événement readystatechange
est déclenché lorsque l'attribut readyState
d'un document a changé.
Property | Type | Description |
---|---|---|
target {{readonlyInline}} |
{{domxref("EventTarget")}} | The event target (the topmost target in the DOM tree). |
type {{readonlyInline}} |
{{domxref("DOMString")}} | The type of event. |
bubbles {{readonlyInline}} |
{{jsxref("Boolean")}} | Whether the event normally bubbles or not. |
cancelable {{readonlyInline}} |
{{jsxref("Boolean")}} | Whether the event is cancellable or not. |
document.readyState === "complete"; // true //alternative à DOMContentLoaded document.onreadystatechange = function () { if (document.readyState == "interactive") { initApplication(); } }
Cet événement a longtemps été soutenue par Internet Explorer et peut être utilisé comme une alternative à l'evenement DOMContentLoaded
(voir la note [2] de la section Navigateurs compatibles).