From 39f2114f9797eb51994966c6bb8ff1814c9a4da8 Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Thu, 11 Feb 2021 12:36:08 +0100 Subject: unslug fr: move --- files/fr/web/api/document/activeelement/index.html | 25 ------- files/fr/web/api/document/anchors/index.html | 80 ++++++++++++++++++++ .../web/api/document/document.anchors/index.html | 80 -------------------- .../web/api/document/elementfrompoint/index.html | 53 ------------- files/fr/web/api/document/getselection/index.html | 15 ---- .../api/document/readystatechange_event/index.html | 87 ++++++++++++++++++++++ files/fr/web/api/document/stylesheets/index.html | 56 -------------- 7 files changed, 167 insertions(+), 229 deletions(-) delete mode 100644 files/fr/web/api/document/activeelement/index.html create mode 100644 files/fr/web/api/document/anchors/index.html delete mode 100644 files/fr/web/api/document/document.anchors/index.html delete mode 100644 files/fr/web/api/document/elementfrompoint/index.html delete mode 100644 files/fr/web/api/document/getselection/index.html create mode 100644 files/fr/web/api/document/readystatechange_event/index.html delete mode 100644 files/fr/web/api/document/stylesheets/index.html (limited to 'files/fr/web/api/document') diff --git a/files/fr/web/api/document/activeelement/index.html b/files/fr/web/api/document/activeelement/index.html deleted file mode 100644 index 5115a1135c..0000000000 --- a/files/fr/web/api/document/activeelement/index.html +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: document.activeElement -slug: Web/API/Document/activeElement -tags: - - Référence_du_DOM_Gecko -translation_of: Web/API/DocumentOrShadowRoot/activeElement -translation_of_original: Web/API/Document/activeElement ---- -

{{ ApiRef() }}

-

Résumé

-

Renvoie l'élément qui dispose actuellement du focus.

-

{{ Note("Cet attribut fait partie de la spécification HTML 5 encore en développement.") }}

-

Syntaxe

-
var elemCourant = document.activeElement;
-
-

Exemple

-

Spécification

- -

 

-

 

-
-  
-

{{ languages( { "en": "en/DOM/document.activeElement", "es": "es/DOM/element.activeElement", "ja": "ja/DOM/document.activeElement", "pl": "pl/DOM/document.activeElement" } ) }}

diff --git a/files/fr/web/api/document/anchors/index.html b/files/fr/web/api/document/anchors/index.html new file mode 100644 index 0000000000..09fadf1b61 --- /dev/null +++ b/files/fr/web/api/document/anchors/index.html @@ -0,0 +1,80 @@ +--- +title: Document.anchors +slug: Web/API/Document/Document.anchors +translation_of: Web/API/Document/anchors +--- +
{{APIRef("DOM")}} {{deprecated_header()}}
+ +

anchors retourne une liste de toutes les ancres du document.

+ +

Syntaxe

+ +
nodeList = document.anchors;
+
+ +

Exemple

+ +
if ( document.anchors.length >= 5 ) {
+  dump("Trop d'ancres trouvées !");
+  window.location = "http://www.google.com";
+}
+
+ +

L'exemple suivant remplit un tableau avec chaque ancre présente sur la page :

+ +
<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="UTF-8" />
+<title>Test</title>
+<script>
+function init() {
+  var toc = document.getElementById("toc");
+  var i, li, newAnchor;
+  for (i = 0; i < document.anchors.length; i++) {
+    li = document.createElement("li");
+    newAnchor = document.createElement('a');
+    newAnchor.href = "#" + document.anchors[i].name;
+    newAnchor.innerHTML = document.anchors[i].text;
+    li.appendChild(newAnchor);
+    toc.appendChild(li);
+  }
+}
+</script>
+
+</head>
+<body onload="init()">
+
+<h1>Title</h1>
+<h2><a name="contents">Contents</a></h2>
+<ul id="toc"></ul>
+
+<h2><a name="plants">Plants</a></h2>
+<ol>
+    <li>Apples</li>
+    <li>Oranges</li>
+    <li>Pears</li>
+</ol>
+
+<h2><a name="veggies">Veggies</a></h2>
+<ol>
+    <li>Carrots</li>
+    <li>Celery</li>
+    <li>Beats</li>
+</ol>
+
+</body>
+</html>
+
+ +

Voir dans JSFiddle

+ +

Notes

+ +

Pour des raisons de rétrocompatibilité, la liste d'ancres retournée contient seulement les ancres créées avec l'attribut name, pas celles créées avec l'attribut id.

+ +

Spécification

+ + diff --git a/files/fr/web/api/document/document.anchors/index.html b/files/fr/web/api/document/document.anchors/index.html deleted file mode 100644 index 09fadf1b61..0000000000 --- a/files/fr/web/api/document/document.anchors/index.html +++ /dev/null @@ -1,80 +0,0 @@ ---- -title: Document.anchors -slug: Web/API/Document/Document.anchors -translation_of: Web/API/Document/anchors ---- -
{{APIRef("DOM")}} {{deprecated_header()}}
- -

anchors retourne une liste de toutes les ancres du document.

- -

Syntaxe

- -
nodeList = document.anchors;
-
- -

Exemple

- -
if ( document.anchors.length >= 5 ) {
-  dump("Trop d'ancres trouvées !");
-  window.location = "http://www.google.com";
-}
-
- -

L'exemple suivant remplit un tableau avec chaque ancre présente sur la page :

- -
<!DOCTYPE html>
-<html lang="en">
-<head>
-<meta charset="UTF-8" />
-<title>Test</title>
-<script>
-function init() {
-  var toc = document.getElementById("toc");
-  var i, li, newAnchor;
-  for (i = 0; i < document.anchors.length; i++) {
-    li = document.createElement("li");
-    newAnchor = document.createElement('a');
-    newAnchor.href = "#" + document.anchors[i].name;
-    newAnchor.innerHTML = document.anchors[i].text;
-    li.appendChild(newAnchor);
-    toc.appendChild(li);
-  }
-}
-</script>
-
-</head>
-<body onload="init()">
-
-<h1>Title</h1>
-<h2><a name="contents">Contents</a></h2>
-<ul id="toc"></ul>
-
-<h2><a name="plants">Plants</a></h2>
-<ol>
-    <li>Apples</li>
-    <li>Oranges</li>
-    <li>Pears</li>
-</ol>
-
-<h2><a name="veggies">Veggies</a></h2>
-<ol>
-    <li>Carrots</li>
-    <li>Celery</li>
-    <li>Beats</li>
-</ol>
-
-</body>
-</html>
-
- -

Voir dans JSFiddle

- -

Notes

- -

Pour des raisons de rétrocompatibilité, la liste d'ancres retournée contient seulement les ancres créées avec l'attribut name, pas celles créées avec l'attribut id.

- -

Spécification

- - diff --git a/files/fr/web/api/document/elementfrompoint/index.html b/files/fr/web/api/document/elementfrompoint/index.html deleted file mode 100644 index 493d7a55a1..0000000000 --- a/files/fr/web/api/document/elementfrompoint/index.html +++ /dev/null @@ -1,53 +0,0 @@ ---- -title: document.elementFromPoint -slug: Web/API/Document/elementFromPoint -tags: - - Référence_du_DOM_Gecko -translation_of: Web/API/DocumentOrShadowRoot/elementFromPoint -translation_of_original: Web/API/Document/elementFromPoint ---- -

{{ ApiRef() }}

-

Résumé

-

Renvoie l'élément visible au point donné, spécifié relativement au point supérieur gauche visible dans le document.

-

Syntaxe

-
element = document.elementFromPoint(x,y);
-
-

where

- -

Exemple

-
<html>
-<head>
-<title>Exemple d'utilisation d'elementFromPoint</title>
-
-<script type="text/javascript">
-
-function changeColor(newColor)
-{
- elem = document.elementFromPoint(2, 2);
- elem.style.color = newColor;
-}
-</script>
-</head>
-
-<body>
-<p id="para1">Un peu de texte ici</p>
-<button onclick="changeColor('blue');">bleu</button>
-<button onclick="changeColor('red');">rouge</button>
-</body>
-</html>
-
-

Notes

-

Si l'élément au point spécifié appartient à un autre document (par exemple, les sous-document d'un iframe), l'élément dans le DOM du document appelant (l'iframe lui-même) est renvoyé. Si l'élément au point donné est anonyme ou du contenu généré par XBL, comme la barre de défilement d'une boîte de texte, le premier élément parent non anonyme (par exemple, la boîte de texte) est renvoyé.

-

Si le point spécifié est en dehors de la portion visible du document ou que l'une ou l'autre des coordonnées est négative, le résultat est NULL.

-

{{ Note("Les appelants qui sont des documents XUL devraient attendre que l\'évènement onload se soit déclenché avant d\'appeler cette méthode.") }}

-

Spécification

- -

 

-
-  
-

{{ languages( { "en": "en/DOM/document.elementFromPoint", "es": "es/DOM/document.elementFromPoint", "ja": "ja/DOM/document.elementFromPoint" } ) }}

diff --git a/files/fr/web/api/document/getselection/index.html b/files/fr/web/api/document/getselection/index.html deleted file mode 100644 index 9352399ada..0000000000 --- a/files/fr/web/api/document/getselection/index.html +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: document.getSelection -slug: Web/API/Document/getSelection -tags: - - API - - DOM - - Méthodes - - Reference - - Selection -translation_of: Web/API/DocumentOrShadowRoot/getSelection -translation_of_original: Web/API/Document/getSelection ---- -

{{APIRef("DOM")}}

- -

Cette méthode fonctionne de manière identique à la méthode {{domxref ("Window.getSelection()")}} ; elle renvoie un objet {{domxref ("Selection")}} représentant le texte actuellement sélectionné dans le document.

diff --git a/files/fr/web/api/document/readystatechange_event/index.html b/files/fr/web/api/document/readystatechange_event/index.html new file mode 100644 index 0000000000..f4adf81f7a --- /dev/null +++ b/files/fr/web/api/document/readystatechange_event/index.html @@ -0,0 +1,87 @@ +--- +title: readystatechange +slug: Web/Events/readystatechange +translation_of: Web/API/Document/readystatechange_event +--- +

{{ApiRef}}

+ +

L'événement readystatechange est déclenché lorsque l'attribut readyState d'un document a changé.

+ +

Information générale

+ +
+
Specification
+
HTML5
+
Interface
+
Event
+
Bubbles
+
No
+
Cancelable
+
No
+
Target
+
Document
+
Default Action
+
None.
+
+ +

propriétés

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyTypeDescription
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.
+ +

exemple

+ +
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).

+ +

Les événements liés

+ + diff --git a/files/fr/web/api/document/stylesheets/index.html b/files/fr/web/api/document/stylesheets/index.html deleted file mode 100644 index 0c607adc5f..0000000000 --- a/files/fr/web/api/document/stylesheets/index.html +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: Document.styleSheets -slug: Web/API/Document/styleSheets -translation_of: Web/API/DocumentOrShadowRoot/styleSheets -translation_of_original: Web/API/Document/styleSheets ---- -
{{APIRef}}
- -
La propriété Document.styleSheets est en lecture seule et retourne une liste {{domxref("StyleSheetList")}} d'objets {{domxref("StyleSheet")}}, qui font référence à l'ensemble des feuilles de style contenues ou embarquées dans le document.
- -
 
- -

Syntaxe

- -
var styleSheetList = document.styleSheets;
-
- -

L'objet retourné est une liste {{domxref("StyleSheetList")}}.

- -

Il s'agit d'une collection ordonnée d'objets {{domxref("StyleSheet")}}. styleSheetList.item(index) ou  styleSheetList{{ mediawiki.External('index') }} retourne un seul objet stylesheet par son index (index débute par 0).

- -

Spécification

- - - - - - - - - - - - - - - - - - - - - - - -
SpécificationStatutCommentaire
{{SpecName('CSSOM', '#dom-document-stylesheets', 'styleSheets')}}{{Spec2('CSSOM')}} 
{{SpecName('DOM2 Style', 'stylesheets.html#StyleSheets-DocumentStyle-styleSheets', 'styleSheets')}}{{Spec2('DOM2 Style')}} 
- -

Voir aussi

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