aboutsummaryrefslogtreecommitdiff
path: root/files/fr/web/api/window/top/index.html
blob: 01b394037fd67bb1db8b4564de5f29f8cfd0bc75 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
---
title: Window.top
slug: Web/API/Window/top
tags:
  - API
  - HTML DOM
  - NeedsExample
  - Propriété
  - Reference
  - Window
translation_of: Web/API/Window/top
---
<div>{{APIRef}}</div>

<p>Renvoie une référence à la fenêtre la plus haute dans la hiérarchie des fenêtres</p>

<h2 id="Syntaxe">Syntaxe</h2>

<pre class="syntaxbox notranslate">var <var>topWindow</var> = window.top;
</pre>

<h2 id="Notes">Notes</h2>

<p>Là où la propriété {{domxref("window.parent")}} renvoie le parent immédiat de la fenêtre courante, <code>window.top</code> renvoie la fenêtre la plus haute dans la hiérarchie des objets de fenêtre.</p>

<p>Cette propriété est particulièrement utile lorsque vous avez affaire à une fenêtre qui se trouve dans une subframe d'un ou de plusieurs parents, et que vous souhaitez accéder au jeu de frameset de niveau supérieur.</p>

<h2 id="Spécifications">Spécifications</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Spécification</th>
   <th scope="col">Statut</th>
   <th scope="col">Commentaire</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('HTML WHATWG', 'browsers.html#dom-top', 'window.top')}}</td>
   <td>{{Spec2('HTML WHATWG')}}</td>
   <td></td>
  </tr>
  <tr>
   <td>{{SpecName('HTML5 W3C', 'browsers.html#dom-top', 'window.top')}}</td>
   <td>{{Spec2('HTML5 W3C')}}</td>
   <td>Spécification initiale</td>
  </tr>
 </tbody>
</table>

<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2>

<p>{{Compat("api.Window.top")}}</p>