From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../api/windoweventhandlers/onunload/index.html | 58 ++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 files/fr/web/api/windoweventhandlers/onunload/index.html (limited to 'files/fr/web/api/windoweventhandlers/onunload') diff --git a/files/fr/web/api/windoweventhandlers/onunload/index.html b/files/fr/web/api/windoweventhandlers/onunload/index.html new file mode 100644 index 0000000000..e218cb7656 --- /dev/null +++ b/files/fr/web/api/windoweventhandlers/onunload/index.html @@ -0,0 +1,58 @@ +--- +title: WindowEventHandlers.onunload +slug: Web/API/WindowEventHandlers/onunload +tags: + - API + - Propriétés + - Reference + - WindowEventHandlers +translation_of: Web/API/WindowEventHandlers/onunload +--- +
{{APIRef("HTML DOM")}}
+ +

L'événement unload est déclenché lorsque le contenu et les ressources sont déchargés à la fermeture de la fenêtre. Le processus de suppression des ressources se fait après que l'événement unload a eu lieu.

+ +

Les navigateurs équipés d'un bloqueur de pop-up vont ignorer tout appel de window.open() lancé depuis onunload.

+ +

Syntaxe

+ +
window.addEventListener("unload", function(event) { ... });
+window.onunload = function(event) { ... };
+
+ +

Généralement, mieux vaut utiliser {{domxref("EventTarget.addEventListener", "window.addEventListener()")}} et l'événement {{event("unload")}} plutôt que onunload.

+ +

Spécifications

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
SpécificationÉtatCommentaires
{{SpecName('HTML WHATWG', '#handler-window-onunload', 'onunload')}}{{Spec2('HTML WHATWG')}}
{{SpecName('HTML5.1', '#windoweventhandlers', 'GlobalEventHandlers')}}{{Spec2('HTML5.1')}}
{{SpecName("HTML5 W3C", "#windoweventhandlers", "GlobalEventHandlers")}}{{Spec2('HTML5 W3C')}}
+ +

Compatibilité des navigateurs

+ + + +

{{Compat("api.WindowEventHandlers.onunload")}}

-- cgit v1.2.3-54-g00ecf