From 1afd214b4c6ed965b75ece5e8d75febad8bc7c07 Mon Sep 17 00:00:00 2001 From: MDN Date: Thu, 27 May 2021 00:56:56 +0000 Subject: [CRON] sync translated content --- files/fr/_redirects.txt | 1 + files/fr/_wikihistory.json | 18 ++-- .../web/api/childnode/replacewith/index.html | 118 +++++++++++++++++++++ files/fr/web/api/childnode/replacewith/index.html | 117 -------------------- 4 files changed, 128 insertions(+), 126 deletions(-) create mode 100644 files/fr/orphaned/web/api/childnode/replacewith/index.html delete mode 100644 files/fr/web/api/childnode/replacewith/index.html (limited to 'files/fr') diff --git a/files/fr/_redirects.txt b/files/fr/_redirects.txt index 22ba5716b9..311dd1cdf9 100644 --- a/files/fr/_redirects.txt +++ b/files/fr/_redirects.txt @@ -3615,6 +3615,7 @@ /fr/docs/Web/API/Canvas_API/Tutoriel_canvas/Utilisation_d'images /fr/docs/Web/API/Canvas_API/Tutorial/Using_images /fr/docs/Web/API/Canvas_API/Tutoriel_canvas/Utilisation_de_base /fr/docs/Web/API/Canvas_API/Tutorial/Basic_usage /fr/docs/Web/API/ChildNode/remove /fr/docs/orphaned/Web/API/ChildNode/remove +/fr/docs/Web/API/ChildNode/replaceWith /fr/docs/orphaned/Web/API/ChildNode/replaceWith /fr/docs/Web/API/Commentaire /fr/docs/Web/API/Comment /fr/docs/Web/API/Commentaire/Comment /fr/docs/Web/API/Comment/Comment /fr/docs/Web/API/Console.table /fr/docs/Web/API/Console/table diff --git a/files/fr/_wikihistory.json b/files/fr/_wikihistory.json index 99ed1bb69a..dce94aa003 100644 --- a/files/fr/_wikihistory.json +++ b/files/fr/_wikihistory.json @@ -13087,15 +13087,6 @@ "loella16" ] }, - "Web/API/ChildNode/replaceWith": { - "modified": "2020-10-15T21:55:03.476Z", - "contributors": [ - "tristantheb", - "loella16", - "Spictheweb", - "v-Stein" - ] - }, "Web/API/Client": { "modified": "2020-11-16T08:56:05.543Z", "contributors": [ @@ -45034,6 +45025,15 @@ "Copen" ] }, + "orphaned/Web/API/ChildNode/replaceWith": { + "modified": "2020-10-15T21:55:03.476Z", + "contributors": [ + "tristantheb", + "loella16", + "Spictheweb", + "v-Stein" + ] + }, "orphaned/Web/API/Detecting_device_orientation": { "modified": "2019-03-23T23:28:22.437Z", "contributors": [ diff --git a/files/fr/orphaned/web/api/childnode/replacewith/index.html b/files/fr/orphaned/web/api/childnode/replacewith/index.html new file mode 100644 index 0000000000..675e7c6026 --- /dev/null +++ b/files/fr/orphaned/web/api/childnode/replacewith/index.html @@ -0,0 +1,118 @@ +--- +title: ChildNode.replaceWith() +slug: orphaned/Web/API/ChildNode/replaceWith +tags: + - API + - DOM + - Méthodes + - Noeuds + - Reference +translation_of: Web/API/ChildNode/replaceWith +original_slug: Web/API/ChildNode/replaceWith +--- +
{{APIRef("DOM")}}
+La méthode ChildNode.replaceWith() remplace ce ChildNode de la liste des enfants de son parent par un ensemble d'objets {{domxref("Node")}} (noeud) ou {{domxref("DOMString")}} (chaîne de caractères).
+Les objets {{domxref("DOMString")}} sont insérés en tant que noeuds {{domxref("Text")}}.
+ +

Syntaxe

+ +
[Throws, Unscopable]
+void ChildNode.replaceWith((Node ou DOMString)... nodes);
+
+ +

Paramètres

+ +
+
nodes
+
Un ensemble d'objets {{domxref("Node")}} (noeud) ou {{domxref("DOMString")}} (chaîne de caractères) à remplacer.
+
+ +

Exceptions

+ + + +

Exemples

+ +

Utilisation de replaceWith()

+ +
var parent = document.createElement("div");
+var enfant = document.createElement("p");
+parent.appendChild(enfant);
+var span = document.createElement("span");
+
+enfant.replaceWith(span);
+
+console.log(parent.outerHTML);
+// "<div><span></span></div>"
+
+ +

ChildNode.replaceWith() n'est pas accessible

+ +

La méthode replaceWith() n'est pas comprise dans une instruction with. Voir {{jsxref("Symbol.unscopables")}} pour plus d'informations.

+ +
with(node) {
+  replaceWith("foo");
+}
+// ReferenceError: replaceWith n'est pas défini 
+ +

Prothèse d'émulation

+ +

Vous pouvez utiliser une prothèse d'émulation pour la méthode replaceWith() pour Internet Explorer 10 et plus avec le code suivant :

+ +
function ReplaceWith(Ele) {
+  'use-strict'; // For safari, and IE > 10
+  var parent = this.parentNode,
+      i = arguments.length,
+      firstIsNode = +(parent && typeof Ele === 'object');
+  if (!parent) return;
+
+  while (i-- > firstIsNode){
+    if (parent && typeof arguments[i] !== 'object'){
+      arguments[i] = document.createTextNode(arguments[i]);
+    } if (!parent && arguments[i].parentNode){
+      arguments[i].parentNode.removeChild(arguments[i]);
+      continue;
+    }
+    parent.insertBefore(this.previousSibling, arguments[i]);
+  }
+  if (firstIsNode) parent.replaceChild(Ele, this);
+}
+if (!Element.prototype.replaceWith)
+    Element.prototype.replaceWith = ReplaceWith;
+if (!CharacterData.prototype.replaceWith)
+    CharacterData.prototype.replaceWith = ReplaceWith;
+if (!DocumentType.prototype.replaceWith)
+    DocumentType.prototype.replaceWith = ReplaceWith;
+ +

Spécification

+ + + + + + + + + + + + + + +
SpécificationÉtatCommentaire
{{SpecName('DOM WHATWG', '#dom-childnode-replacewith', 'ChildNode.replacewith()')}}{{Spec2('DOM WHATWG')}}Définition initiale.
+ +

Compatibilité des navigateurs

+ + + +

{{Compat("api.ChildNode.replaceWith")}}

+ +

Voir aussi

+ + diff --git a/files/fr/web/api/childnode/replacewith/index.html b/files/fr/web/api/childnode/replacewith/index.html deleted file mode 100644 index 3239ceae59..0000000000 --- a/files/fr/web/api/childnode/replacewith/index.html +++ /dev/null @@ -1,117 +0,0 @@ ---- -title: ChildNode.replaceWith() -slug: Web/API/ChildNode/replaceWith -tags: - - API - - DOM - - Méthodes - - Noeuds - - Reference -translation_of: Web/API/ChildNode/replaceWith ---- -
{{APIRef("DOM")}}
-La méthode ChildNode.replaceWith() remplace ce ChildNode de la liste des enfants de son parent par un ensemble d'objets {{domxref("Node")}} (noeud) ou {{domxref("DOMString")}} (chaîne de caractères).
-Les objets {{domxref("DOMString")}} sont insérés en tant que noeuds {{domxref("Text")}}.
- -

Syntaxe

- -
[Throws, Unscopable]
-void ChildNode.replaceWith((Node ou DOMString)... nodes);
-
- -

Paramètres

- -
-
nodes
-
Un ensemble d'objets {{domxref("Node")}} (noeud) ou {{domxref("DOMString")}} (chaîne de caractères) à remplacer.
-
- -

Exceptions

- - - -

Exemples

- -

Utilisation de replaceWith()

- -
var parent = document.createElement("div");
-var enfant = document.createElement("p");
-parent.appendChild(enfant);
-var span = document.createElement("span");
-
-enfant.replaceWith(span);
-
-console.log(parent.outerHTML);
-// "<div><span></span></div>"
-
- -

ChildNode.replaceWith() n'est pas accessible

- -

La méthode replaceWith() n'est pas comprise dans une instruction with. Voir {{jsxref("Symbol.unscopables")}} pour plus d'informations.

- -
with(node) {
-  replaceWith("foo");
-}
-// ReferenceError: replaceWith n'est pas défini 
- -

Prothèse d'émulation

- -

Vous pouvez utiliser une prothèse d'émulation pour la méthode replaceWith() pour Internet Explorer 10 et plus avec le code suivant :

- -
function ReplaceWith(Ele) {
-  'use-strict'; // For safari, and IE > 10
-  var parent = this.parentNode,
-      i = arguments.length,
-      firstIsNode = +(parent && typeof Ele === 'object');
-  if (!parent) return;
-
-  while (i-- > firstIsNode){
-    if (parent && typeof arguments[i] !== 'object'){
-      arguments[i] = document.createTextNode(arguments[i]);
-    } if (!parent && arguments[i].parentNode){
-      arguments[i].parentNode.removeChild(arguments[i]);
-      continue;
-    }
-    parent.insertBefore(this.previousSibling, arguments[i]);
-  }
-  if (firstIsNode) parent.replaceChild(Ele, this);
-}
-if (!Element.prototype.replaceWith)
-    Element.prototype.replaceWith = ReplaceWith;
-if (!CharacterData.prototype.replaceWith)
-    CharacterData.prototype.replaceWith = ReplaceWith;
-if (!DocumentType.prototype.replaceWith)
-    DocumentType.prototype.replaceWith = ReplaceWith;
- -

Spécification

- - - - - - - - - - - - - - -
SpécificationÉtatCommentaire
{{SpecName('DOM WHATWG', '#dom-childnode-replacewith', 'ChildNode.replacewith()')}}{{Spec2('DOM WHATWG')}}Définition initiale.
- -

Compatibilité des navigateurs

- - - -

{{Compat("api.ChildNode.replaceWith")}}

- -

Voir aussi

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