From c05efa8d7ae464235cf83d7c0956e42dc6974103 Mon Sep 17 00:00:00 2001 From: julieng Date: Sat, 2 Oct 2021 17:20:14 +0200 Subject: move *.html to *.md --- .../api/node/comparedocumentposition/index.html | 108 --------------------- .../web/api/node/comparedocumentposition/index.md | 108 +++++++++++++++++++++ 2 files changed, 108 insertions(+), 108 deletions(-) delete mode 100644 files/fr/web/api/node/comparedocumentposition/index.html create mode 100644 files/fr/web/api/node/comparedocumentposition/index.md (limited to 'files/fr/web/api/node/comparedocumentposition') diff --git a/files/fr/web/api/node/comparedocumentposition/index.html b/files/fr/web/api/node/comparedocumentposition/index.html deleted file mode 100644 index a40125b5c1..0000000000 --- a/files/fr/web/api/node/comparedocumentposition/index.html +++ /dev/null @@ -1,108 +0,0 @@ ---- -title: Node.compareDocumentPosition() -slug: Web/API/Node/compareDocumentPosition -tags: - - API - - Arborescence - - DOM - - Méthodes - - Noeuds - - Position -translation_of: Web/API/Node/compareDocumentPosition ---- -
{{APIRef("DOM")}}
- -

La méthode Node.compareDocumentPosition()compare la position du noeud courant par rapport à un autre noeud dans tout autre document.

- -

La valeur retournée est un masque de bits avec les valeurs suivantes :

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NomValeur
DOCUMENT_POSITION_DISCONNECTED1
DOCUMENT_POSITION_PRECEDING2
DOCUMENT_POSITION_FOLLOWING4
DOCUMENT_POSITION_CONTAINS8
DOCUMENT_POSITION_CONTAINED_BY16
DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC32
- -

Syntaxe

- -
node.compareDocumentPosition( otherNode )
-
- -

Exemple

- -
var head = document.getElementsByTagName('head').item(0);
-
-if (head.compareDocumentPosition(document.body) & Node.DOCUMENT_POSITION_FOLLOWING) {
-  console.log("well-formed document");
-} else {
-  console.log("<head> is not before <body>");
-}
-
- -
-

Note : Parce que le résultat renvoyé par compareDocumentPosition est un masque de bits, des opérateurs binaires doivent être utilisés pour des résultats significatifs.

-
- -
-

Note : La première instruction utilise l' item(0) de la méthode NodeList , qui est l'équivalent de getElementsByTagName('head')[0].

-
- -

Spécifications

- - - - - - - - - - - - - - - - - - - -
SpécificationStatutCommentaire
{{SpecName('DOM WHATWG','#dom-node-comparedocumentposition','Node.compareDocumentPosition()')}}{{Spec2('DOM WHATWG')}} 
{{SpecName('DOM3 Core','core.html#Node3-compareDocumentPosition','Node.compareDocumentPosition()')}}{{Spec2('DOM3 Core')}}Définition initiale
- -

Compatibilité des navigateurs

- -

{{Compat("api.Node.compareDocumentPosition")}}

- -

Voir aussi

- - diff --git a/files/fr/web/api/node/comparedocumentposition/index.md b/files/fr/web/api/node/comparedocumentposition/index.md new file mode 100644 index 0000000000..a40125b5c1 --- /dev/null +++ b/files/fr/web/api/node/comparedocumentposition/index.md @@ -0,0 +1,108 @@ +--- +title: Node.compareDocumentPosition() +slug: Web/API/Node/compareDocumentPosition +tags: + - API + - Arborescence + - DOM + - Méthodes + - Noeuds + - Position +translation_of: Web/API/Node/compareDocumentPosition +--- +
{{APIRef("DOM")}}
+ +

La méthode Node.compareDocumentPosition()compare la position du noeud courant par rapport à un autre noeud dans tout autre document.

+ +

La valeur retournée est un masque de bits avec les valeurs suivantes :

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NomValeur
DOCUMENT_POSITION_DISCONNECTED1
DOCUMENT_POSITION_PRECEDING2
DOCUMENT_POSITION_FOLLOWING4
DOCUMENT_POSITION_CONTAINS8
DOCUMENT_POSITION_CONTAINED_BY16
DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC32
+ +

Syntaxe

+ +
node.compareDocumentPosition( otherNode )
+
+ +

Exemple

+ +
var head = document.getElementsByTagName('head').item(0);
+
+if (head.compareDocumentPosition(document.body) & Node.DOCUMENT_POSITION_FOLLOWING) {
+  console.log("well-formed document");
+} else {
+  console.log("<head> is not before <body>");
+}
+
+ +
+

Note : Parce que le résultat renvoyé par compareDocumentPosition est un masque de bits, des opérateurs binaires doivent être utilisés pour des résultats significatifs.

+
+ +
+

Note : La première instruction utilise l' item(0) de la méthode NodeList , qui est l'équivalent de getElementsByTagName('head')[0].

+
+ +

Spécifications

+ + + + + + + + + + + + + + + + + + + +
SpécificationStatutCommentaire
{{SpecName('DOM WHATWG','#dom-node-comparedocumentposition','Node.compareDocumentPosition()')}}{{Spec2('DOM WHATWG')}} 
{{SpecName('DOM3 Core','core.html#Node3-compareDocumentPosition','Node.compareDocumentPosition()')}}{{Spec2('DOM3 Core')}}Définition initiale
+ +

Compatibilité des navigateurs

+ +

{{Compat("api.Node.compareDocumentPosition")}}

+ +

Voir aussi

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