aboutsummaryrefslogtreecommitdiff
path: root/files/fr/web/api/globaleventhandlers/onclose/index.md
blob: a577479e5bf4cf4d15b542860ee32f20f43e1119 (plain)
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
---
title: GlobalEventHandlers.onclose
slug: Web/API/GlobalEventHandlers/onclose
tags:
  - API
  - DOM
  - HTML
  - Property
  - Reference
translation_of: Web/API/GlobalEventHandlers/onclose
---
{{ApiRef("HTML DOM")}}

Un gestionnaire d'évènement utilisé lorsque des évènements de fermeture sont envoyés à la fenêtre (non disponible dans Firefox 2 ou Safari).

## Syntaxe

    window.onclose = funcRef;

### Paramètres

- `funcRef` est une fonction.

## Exemple

```js
window.onclose = resetThatServerThing;
```

## Spécifications

| Spécification                                                                                    | Statut                           | Commentaires |
| ------------------------------------------------------------------------------------------------ | -------------------------------- | ------------ |
| {{SpecName('HTML WHATWG','webappapis.html#handler-onclose','onclose')}} | {{Spec2('HTML WHATWG')}} |              |