From 2d478fb11c4864129dffb10cb43630b2aaf26bc0 Mon Sep 17 00:00:00 2001 From: MDN Date: Tue, 29 Jun 2021 00:35:05 +0000 Subject: [CRON] sync translated content --- files/es/_redirects.txt | 1 + files/es/_wikihistory.json | 14 +- .../es/orphaned/web/api/childnode/after/index.html | 182 ++++++++++++++++++++ files/es/web/api/childnode/after/index.html | 181 -------------------- files/fr/_redirects.txt | 1 + files/fr/_wikihistory.json | 14 +- .../fr/orphaned/web/api/childnode/after/index.html | 185 ++++++++++++++++++++ files/fr/web/api/childnode/after/index.html | 184 -------------------- files/ja/_redirects.txt | 1 + files/ja/_wikihistory.json | 16 +- .../ja/orphaned/web/api/childnode/after/index.html | 185 ++++++++++++++++++++ files/ja/web/api/childnode/after/index.html | 184 -------------------- files/pt-br/_redirects.txt | 1 + files/pt-br/_wikihistory.json | 12 +- .../orphaned/web/api/childnode/after/index.html | 186 +++++++++++++++++++++ files/pt-br/web/api/childnode/after/index.html | 185 -------------------- files/zh-cn/_redirects.txt | 2 + files/zh-cn/_wikihistory.json | 26 +-- .../orphaned/web/api/childnode/after/index.html | 176 +++++++++++++++++++ .../web/api/oscillatornode/stop/index.html | 122 ++++++++++++++ files/zh-cn/web/api/childnode/after/index.html | 175 ------------------- files/zh-cn/web/api/oscillatornode/stop/index.html | 121 -------------- 22 files changed, 1083 insertions(+), 1071 deletions(-) create mode 100644 files/es/orphaned/web/api/childnode/after/index.html delete mode 100644 files/es/web/api/childnode/after/index.html create mode 100644 files/fr/orphaned/web/api/childnode/after/index.html delete mode 100644 files/fr/web/api/childnode/after/index.html create mode 100644 files/ja/orphaned/web/api/childnode/after/index.html delete mode 100644 files/ja/web/api/childnode/after/index.html create mode 100644 files/pt-br/orphaned/web/api/childnode/after/index.html delete mode 100644 files/pt-br/web/api/childnode/after/index.html create mode 100644 files/zh-cn/orphaned/web/api/childnode/after/index.html create mode 100644 files/zh-cn/orphaned/web/api/oscillatornode/stop/index.html delete mode 100644 files/zh-cn/web/api/childnode/after/index.html delete mode 100644 files/zh-cn/web/api/oscillatornode/stop/index.html diff --git a/files/es/_redirects.txt b/files/es/_redirects.txt index 4a1c6a4158..ed34cdbec1 100644 --- a/files/es/_redirects.txt +++ b/files/es/_redirects.txt @@ -1781,6 +1781,7 @@ /es/docs/Web/API/CameraCapabilities.maxExposureCompensation /es/docs/Web/API/CameraCapabilities/maxExposureCompensation /es/docs/Web/API/CameraCapabilities.maxFocusAreas /es/docs/Web/API/CameraCapabilities/maxFocusAreas /es/docs/Web/API/Canvas_API/Tutorial/Compositing/Ejemplo /es/docs/Web/API/Canvas_API/Tutorial/Compositing/Example +/es/docs/Web/API/ChildNode/after /es/docs/orphaned/Web/API/ChildNode/after /es/docs/Web/API/ChildNode/remove /es/docs/orphaned/Web/API/ChildNode/remove /es/docs/Web/API/ChildNode/replaceWith /es/docs/orphaned/Web/API/ChildNode/replaceWith /es/docs/Web/API/Console/tabla /es/docs/Web/API/Console/table diff --git a/files/es/_wikihistory.json b/files/es/_wikihistory.json index e2d81fa61b..b55d070ceb 100644 --- a/files/es/_wikihistory.json +++ b/files/es/_wikihistory.json @@ -5518,13 +5518,6 @@ "jpmedley" ] }, - "Web/API/ChildNode/after": { - "modified": "2020-10-15T21:50:39.528Z", - "contributors": [ - "AlePerez92", - "SoftwareRVG" - ] - }, "Web/API/ChildNode/before": { "modified": "2019-03-23T22:23:28.772Z", "contributors": [ @@ -23231,6 +23224,13 @@ "guiller1998" ] }, + "orphaned/Web/API/ChildNode/after": { + "modified": "2020-10-15T21:50:39.528Z", + "contributors": [ + "AlePerez92", + "SoftwareRVG" + ] + }, "orphaned/Web/API/ChildNode/remove": { "modified": "2020-10-15T21:50:43.901Z", "contributors": [ diff --git a/files/es/orphaned/web/api/childnode/after/index.html b/files/es/orphaned/web/api/childnode/after/index.html new file mode 100644 index 0000000000..468dfd58ae --- /dev/null +++ b/files/es/orphaned/web/api/childnode/after/index.html @@ -0,0 +1,182 @@ +--- +title: ChildNode.after() +slug: orphaned/Web/API/ChildNode/after +tags: + - API + - DOM + - Experimental + - Nodo + - Referencia + - metodo +translation_of: Web/API/ChildNode/after +original_slug: Web/API/ChildNode/after +--- +

{{APIRef("DOM")}} {{SeeCompatTable}}
+ El método ChildNode.after() inserta un conjunto de objetos {{domxref("Node")}} o {{domxref("DOMString")}} en la lista de hijos de este ChildNode del padre, justo después de este ChildNode. Los objetos {{domxref("DOMString")}} se insertan como nodos equivalentes {{domxref("Text")}}.

+ +

Sintaxis

+ +
[Throws, Unscopable]
+void ChildNode.after((Node o DOMString)... nodes);
+
+ +

Parámetros

+ +
+
nodes
+
Un conjunto de objetos {{domxref("Node")}} o {{domxref("DOMString")}} para insertar.
+
+ +

Excepciones

+ + + +

Ejemplos

+ +

Insertando un elemento

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

Insertando texto

+ +
var parent = document.createElement("div");
+var child = document.createElement("p");
+parent.appendChild(child);
+
+child.after("Text");
+
+console.log(parent.outerHTML);
+// "<div><p></p>Text</div>"
+ +

Insertando un elemento y texto

+ +
var parent = document.createElement("div");
+var child = document.createElement("p");
+parent.appendChild(child);
+var span = document.createElement("span");
+
+child.after(span, "Text");
+
+console.log(parent.outerHTML);
+// "<div><p></p><span></span>Text</div>"
+ +

ChildNode.after() es unscopable

+ +

El método after() no está incluido en la declaración with.Consulte {{jsxref("Symbol.unscopables")}} para obtener más información.

+ +
with(node) {
+  after("foo");
+}
+// ReferenceError: after is not defined 
+ +

Polyfill

+ +

Puedes usar un polyfill del método after() en Internet Explorer 9 y superiores con el siguente código:

+ +
// from: https://github.com/jserz/js_piece/blob/master/DOM/ChildNode/after()/after().md
+(function (arr) {
+  arr.forEach(function (item) {
+    if (item.hasOwnProperty('after')) {
+      return;
+    }
+    Object.defineProperty(item, 'after', {
+      configurable: true,
+      enumerable: true,
+      writable: true,
+      value: function after() {
+        var argArr = Array.prototype.slice.call(arguments),
+          docFrag = document.createDocumentFragment();
+
+        argArr.forEach(function (argItem) {
+          var isNode = argItem instanceof Node;
+          docFrag.appendChild(isNode ? argItem : document.createTextNode(String(argItem)));
+        });
+
+        this.parentNode.insertBefore(docFrag, this.nextSibling);
+      }
+    });
+  });
+})([Element.prototype, CharacterData.prototype, DocumentType.prototype]);
+ +

Otro polyfill

+ +
// from: https://github.com/FabioVergani/js-Polyfill_Element.prototype.after/blob/master/after.js
+
+(function(x){
+ var o=x.prototype,p='after';
+ if(!o[p]){
+    o[p]=function(){
+     var e, m=arguments, l=m.length, i=0, t=this, p=t.parentNode, n=Node, s=String, d=document;
+     if(p!==null){
+        while(i<l){
+         e=m[i];
+         if(e instanceof n){
+            t=t.nextSibling;
+            if(t!==null){
+                p.insertBefore(e,t);
+            }else{
+                p.appendChild(e);
+            };
+         }else{
+            p.appendChild(d.createTextNode(s(e)));
+         };
+         ++i;
+        };
+     };
+    };
+ };
+})(Element);
+
+
+
+/*
+minified:
+
+(function(x){
+ var o=x.prototype;
+ o.after||(o.after=function(){var e,m=arguments,l=m.length,i=0,t=this,p=t.parentNode,n=Node,s=String,d=document;if(p!==null){while(i<l){((e=m[i]) instanceof n)?(((t=t.nextSibling )!==null)?p.insertBefore(e,t):p.appendChild(e)):p.appendChild(d.createTextNode(s(e)));++i;}}});
+}(Element));
+*/
+
+ +

Especificación

+ + + + + + + + + + + + + + +
EspecificaciónEstadoComentario
{{SpecName('DOM WHATWG', '#dom-childnode-after', 'ChildNode.after()')}}{{Spec2('DOM WHATWG')}}Definición Inicial.
+ +

Compatibilidad con navegadores

+ +

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

+ +

Ver también

+ + diff --git a/files/es/web/api/childnode/after/index.html b/files/es/web/api/childnode/after/index.html deleted file mode 100644 index b6512e73c0..0000000000 --- a/files/es/web/api/childnode/after/index.html +++ /dev/null @@ -1,181 +0,0 @@ ---- -title: ChildNode.after() -slug: Web/API/ChildNode/after -tags: - - API - - DOM - - Experimental - - Nodo - - Referencia - - metodo -translation_of: Web/API/ChildNode/after ---- -

{{APIRef("DOM")}} {{SeeCompatTable}}
- El método ChildNode.after() inserta un conjunto de objetos {{domxref("Node")}} o {{domxref("DOMString")}} en la lista de hijos de este ChildNode del padre, justo después de este ChildNode. Los objetos {{domxref("DOMString")}} se insertan como nodos equivalentes {{domxref("Text")}}.

- -

Sintaxis

- -
[Throws, Unscopable]
-void ChildNode.after((Node o DOMString)... nodes);
-
- -

Parámetros

- -
-
nodes
-
Un conjunto de objetos {{domxref("Node")}} o {{domxref("DOMString")}} para insertar.
-
- -

Excepciones

- - - -

Ejemplos

- -

Insertando un elemento

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

Insertando texto

- -
var parent = document.createElement("div");
-var child = document.createElement("p");
-parent.appendChild(child);
-
-child.after("Text");
-
-console.log(parent.outerHTML);
-// "<div><p></p>Text</div>"
- -

Insertando un elemento y texto

- -
var parent = document.createElement("div");
-var child = document.createElement("p");
-parent.appendChild(child);
-var span = document.createElement("span");
-
-child.after(span, "Text");
-
-console.log(parent.outerHTML);
-// "<div><p></p><span></span>Text</div>"
- -

ChildNode.after() es unscopable

- -

El método after() no está incluido en la declaración with.Consulte {{jsxref("Symbol.unscopables")}} para obtener más información.

- -
with(node) {
-  after("foo");
-}
-// ReferenceError: after is not defined 
- -

Polyfill

- -

Puedes usar un polyfill del método after() en Internet Explorer 9 y superiores con el siguente código:

- -
// from: https://github.com/jserz/js_piece/blob/master/DOM/ChildNode/after()/after().md
-(function (arr) {
-  arr.forEach(function (item) {
-    if (item.hasOwnProperty('after')) {
-      return;
-    }
-    Object.defineProperty(item, 'after', {
-      configurable: true,
-      enumerable: true,
-      writable: true,
-      value: function after() {
-        var argArr = Array.prototype.slice.call(arguments),
-          docFrag = document.createDocumentFragment();
-
-        argArr.forEach(function (argItem) {
-          var isNode = argItem instanceof Node;
-          docFrag.appendChild(isNode ? argItem : document.createTextNode(String(argItem)));
-        });
-
-        this.parentNode.insertBefore(docFrag, this.nextSibling);
-      }
-    });
-  });
-})([Element.prototype, CharacterData.prototype, DocumentType.prototype]);
- -

Otro polyfill

- -
// from: https://github.com/FabioVergani/js-Polyfill_Element.prototype.after/blob/master/after.js
-
-(function(x){
- var o=x.prototype,p='after';
- if(!o[p]){
-    o[p]=function(){
-     var e, m=arguments, l=m.length, i=0, t=this, p=t.parentNode, n=Node, s=String, d=document;
-     if(p!==null){
-        while(i<l){
-         e=m[i];
-         if(e instanceof n){
-            t=t.nextSibling;
-            if(t!==null){
-                p.insertBefore(e,t);
-            }else{
-                p.appendChild(e);
-            };
-         }else{
-            p.appendChild(d.createTextNode(s(e)));
-         };
-         ++i;
-        };
-     };
-    };
- };
-})(Element);
-
-
-
-/*
-minified:
-
-(function(x){
- var o=x.prototype;
- o.after||(o.after=function(){var e,m=arguments,l=m.length,i=0,t=this,p=t.parentNode,n=Node,s=String,d=document;if(p!==null){while(i<l){((e=m[i]) instanceof n)?(((t=t.nextSibling )!==null)?p.insertBefore(e,t):p.appendChild(e)):p.appendChild(d.createTextNode(s(e)));++i;}}});
-}(Element));
-*/
-
- -

Especificación

- - - - - - - - - - - - - - -
EspecificaciónEstadoComentario
{{SpecName('DOM WHATWG', '#dom-childnode-after', 'ChildNode.after()')}}{{Spec2('DOM WHATWG')}}Definición Inicial.
- -

Compatibilidad con navegadores

- -

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

- -

Ver también

- - diff --git a/files/fr/_redirects.txt b/files/fr/_redirects.txt index 23e84fb359..d894bac2de 100644 --- a/files/fr/_redirects.txt +++ b/files/fr/_redirects.txt @@ -3616,6 +3616,7 @@ /fr/docs/Web/API/Canvas_API/Tutoriel_canvas/Transformations /fr/docs/Web/API/Canvas_API/Tutorial/Transformations /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/after /fr/docs/orphaned/Web/API/ChildNode/after /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 diff --git a/files/fr/_wikihistory.json b/files/fr/_wikihistory.json index b995cd3194..8624a0d6a0 100644 --- a/files/fr/_wikihistory.json +++ b/files/fr/_wikihistory.json @@ -13029,13 +13029,6 @@ "bchaplet" ] }, - "Web/API/ChildNode/after": { - "modified": "2020-10-15T21:56:14.439Z", - "contributors": [ - "loella16", - "BEHOUBA" - ] - }, "Web/API/ChildNode/before": { "modified": "2020-10-15T22:01:12.319Z", "contributors": [ @@ -44602,6 +44595,13 @@ "SphinxKnight" ] }, + "orphaned/Web/API/ChildNode/after": { + "modified": "2020-10-15T21:56:14.439Z", + "contributors": [ + "loella16", + "BEHOUBA" + ] + }, "orphaned/Web/API/ChildNode/remove": { "modified": "2020-10-15T21:49:32.341Z", "contributors": [ diff --git a/files/fr/orphaned/web/api/childnode/after/index.html b/files/fr/orphaned/web/api/childnode/after/index.html new file mode 100644 index 0000000000..d1630a891e --- /dev/null +++ b/files/fr/orphaned/web/api/childnode/after/index.html @@ -0,0 +1,185 @@ +--- +title: ChildNode.after() +slug: orphaned/Web/API/ChildNode/after +tags: + - API + - DOM + - Méthode + - Noeud + - Reference +translation_of: Web/API/ChildNode/after +original_slug: Web/API/ChildNode/after +--- +
{{APIRef ("DOM")}} {{SeeCompatTable}}
+ +
La méthode ChildNode.after () insère un ensemble d'objets {{domxref ("Node")}} ou {{domxref ("DOMString")}} dans la liste des enfants de ce parent de ChildNode, juste après ce ChildNode. Les objets {{domxref ("DOMString")}} sont insérés comme des noeuds {{domxref ("Text")}} équivalents.
+ +

Syntaxe

+ +
[Throws, Unscopable]
+void ChildNode.after((Node or DOMString)... nodes);
+
+ +

Paramètres

+ +
+
nodes
+
Un ensemble d'objets {{domxref ("Node")}} ou {{domxref ("DOMString")}} à insérer.
+
+ +

Exceptions

+ + + +

Exemples

+ +

Insertion d'un élément

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

Insertion d'un texte

+ +
var parent = document.createElement("div");
+var child = document.createElement("p");
+parent.appendChild(child);
+
+child.after("Text");
+
+console.log(parent.outerHTML);
+// "<div><p></p>Text</div>"
+ +

Insertion d'un élément et de  texte

+ +
var parent = document.createElement("div");
+var child = document.createElement("p");
+parent.appendChild(child);
+var span = document.createElement("span");
+
+child.after(span, "Text");
+
+console.log(parent.outerHTML);
+// "<div><p></p><span></span>Text</div>"
+ +

ChildNode.after() n'est pas accessible

+ +

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

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

Polyfill

+ +

Vous pouvez appliquer la méthode after() dans Internet Explorer 9 et plus haut avec le code suivant :

+ +
//de : https://github.com/jserz/js_piece/blob/master/DOM/ChildNode/after()/after().md
+(function (arr) {
+  arr.forEach(function (item) {
+    if (item.hasOwnProperty('after')) {
+      return;
+    }
+    Object.defineProperty(item, 'after', {
+      configurable: true,
+      enumerable: true,
+      writable: true,
+      value: function after() {
+        var argArr = Array.prototype.slice.call(arguments),
+          docFrag = document.createDocumentFragment();
+
+        argArr.forEach(function (argItem) {
+          var isNode = argItem instanceof Node;
+          docFrag.appendChild(isNode ? argItem : document.createTextNode(String(argItem)));
+        });
+
+        this.parentNode.insertBefore(docFrag, this.nextSibling);
+      }
+    });
+  });
+})([Element.prototype, CharacterData.prototype, DocumentType.prototype]);
+ +

 

+ +
//https://github.com/FabioVergani/js-Polyfill_Element.prototype.after/blob/master/after.js
+
+(function(x){
+ var o=x.prototype,p='after';
+ if(!o[p]){
+    o[p]=function(){
+     var e, m=arguments, l=m.length, i=0, t=this, p=t.parentNode, n=Node, s=String, d=document;
+     if(p!==null){
+        while(i<l){
+         e=m[i];
+         if(e instanceof n){
+            t=t.nextSibling;
+            if(t!==null){
+                p.insertBefore(e,t);
+            }else{
+                p.appendChild(e);
+            };
+         }else{
+            p.appendChild(d.createTextNode(s(e)));
+         };
+         ++i;
+        };
+     };
+    };
+ };
+})(Element);
+
+
+
+/*
+min:
+
+(function(x){
+ var o=x.prototype;
+ o.after||(o.after=function(){var e,m=arguments,l=m.length,i=0,t=this,p=t.parentNode,n=Node,s=String,d=document;if(p!==null){while(i<l){((e=m[i]) instanceof n)?(((t=t.nextSibling )!==null)?p.insertBefore(e,t):p.appendChild(e)):p.appendChild(d.createTextNode(s(e)));++i;}}});
+}(Element));
+
+*/
+
+ +

 

+ +

Spécification

+ + + + + + + + + + + + + + +
SpécificationStatutCommentaire
{{SpecName('DOM WHATWG', '#dom-childnode-after', 'ChildNode.after()')}}{{Spec2('DOM WHATWG')}}Définition initiale.
+ +

Compatibilité des navigateurs

+ +

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

+ +

Voir aussi

+ + diff --git a/files/fr/web/api/childnode/after/index.html b/files/fr/web/api/childnode/after/index.html deleted file mode 100644 index 474d64a307..0000000000 --- a/files/fr/web/api/childnode/after/index.html +++ /dev/null @@ -1,184 +0,0 @@ ---- -title: ChildNode.after() -slug: Web/API/ChildNode/after -tags: - - API - - DOM - - Méthode - - Noeud - - Reference -translation_of: Web/API/ChildNode/after ---- -
{{APIRef ("DOM")}} {{SeeCompatTable}}
- -
La méthode ChildNode.after () insère un ensemble d'objets {{domxref ("Node")}} ou {{domxref ("DOMString")}} dans la liste des enfants de ce parent de ChildNode, juste après ce ChildNode. Les objets {{domxref ("DOMString")}} sont insérés comme des noeuds {{domxref ("Text")}} équivalents.
- -

Syntaxe

- -
[Throws, Unscopable]
-void ChildNode.after((Node or DOMString)... nodes);
-
- -

Paramètres

- -
-
nodes
-
Un ensemble d'objets {{domxref ("Node")}} ou {{domxref ("DOMString")}} à insérer.
-
- -

Exceptions

- - - -

Exemples

- -

Insertion d'un élément

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

Insertion d'un texte

- -
var parent = document.createElement("div");
-var child = document.createElement("p");
-parent.appendChild(child);
-
-child.after("Text");
-
-console.log(parent.outerHTML);
-// "<div><p></p>Text</div>"
- -

Insertion d'un élément et de  texte

- -
var parent = document.createElement("div");
-var child = document.createElement("p");
-parent.appendChild(child);
-var span = document.createElement("span");
-
-child.after(span, "Text");
-
-console.log(parent.outerHTML);
-// "<div><p></p><span></span>Text</div>"
- -

ChildNode.after() n'est pas accessible

- -

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

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

Polyfill

- -

Vous pouvez appliquer la méthode after() dans Internet Explorer 9 et plus haut avec le code suivant :

- -
//de : https://github.com/jserz/js_piece/blob/master/DOM/ChildNode/after()/after().md
-(function (arr) {
-  arr.forEach(function (item) {
-    if (item.hasOwnProperty('after')) {
-      return;
-    }
-    Object.defineProperty(item, 'after', {
-      configurable: true,
-      enumerable: true,
-      writable: true,
-      value: function after() {
-        var argArr = Array.prototype.slice.call(arguments),
-          docFrag = document.createDocumentFragment();
-
-        argArr.forEach(function (argItem) {
-          var isNode = argItem instanceof Node;
-          docFrag.appendChild(isNode ? argItem : document.createTextNode(String(argItem)));
-        });
-
-        this.parentNode.insertBefore(docFrag, this.nextSibling);
-      }
-    });
-  });
-})([Element.prototype, CharacterData.prototype, DocumentType.prototype]);
- -

 

- -
//https://github.com/FabioVergani/js-Polyfill_Element.prototype.after/blob/master/after.js
-
-(function(x){
- var o=x.prototype,p='after';
- if(!o[p]){
-    o[p]=function(){
-     var e, m=arguments, l=m.length, i=0, t=this, p=t.parentNode, n=Node, s=String, d=document;
-     if(p!==null){
-        while(i<l){
-         e=m[i];
-         if(e instanceof n){
-            t=t.nextSibling;
-            if(t!==null){
-                p.insertBefore(e,t);
-            }else{
-                p.appendChild(e);
-            };
-         }else{
-            p.appendChild(d.createTextNode(s(e)));
-         };
-         ++i;
-        };
-     };
-    };
- };
-})(Element);
-
-
-
-/*
-min:
-
-(function(x){
- var o=x.prototype;
- o.after||(o.after=function(){var e,m=arguments,l=m.length,i=0,t=this,p=t.parentNode,n=Node,s=String,d=document;if(p!==null){while(i<l){((e=m[i]) instanceof n)?(((t=t.nextSibling )!==null)?p.insertBefore(e,t):p.appendChild(e)):p.appendChild(d.createTextNode(s(e)));++i;}}});
-}(Element));
-
-*/
-
- -

 

- -

Spécification

- - - - - - - - - - - - - - -
SpécificationStatutCommentaire
{{SpecName('DOM WHATWG', '#dom-childnode-after', 'ChildNode.after()')}}{{Spec2('DOM WHATWG')}}Définition initiale.
- -

Compatibilité des navigateurs

- -

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

- -

Voir aussi

- - diff --git a/files/ja/_redirects.txt b/files/ja/_redirects.txt index 7003c6aaed..86f53f55f0 100644 --- a/files/ja/_redirects.txt +++ b/files/ja/_redirects.txt @@ -3726,6 +3726,7 @@ /ja/docs/Web/API/CanvasRenderingContext2D.drawFocusIfNeeded /ja/docs/Web/API/CanvasRenderingContext2D/drawFocusIfNeeded /ja/docs/Web/API/CanvasRenderingContext2D.removeHitRegion /ja/docs/Web/API/CanvasRenderingContext2D/removeHitRegion /ja/docs/Web/API/Canvas_API/Drawing_graphics_with_canvas /ja/docs/Web/API/Canvas_API/Tutorial +/ja/docs/Web/API/ChildNode/after /ja/docs/orphaned/Web/API/ChildNode/after /ja/docs/Web/API/ChildNode/remove /ja/docs/orphaned/Web/API/ChildNode/remove /ja/docs/Web/API/ChildNode/replaceWith /ja/docs/orphaned/Web/API/ChildNode/replaceWith /ja/docs/Web/API/Console.error /ja/docs/Web/API/Console/error diff --git a/files/ja/_wikihistory.json b/files/ja/_wikihistory.json index 00c5e43e3d..4028537bb6 100644 --- a/files/ja/_wikihistory.json +++ b/files/ja/_wikihistory.json @@ -11605,14 +11605,6 @@ "momoi" ] }, - "Web/API/ChildNode/after": { - "modified": "2020-10-17T21:33:51.563Z", - "contributors": [ - "dskmori", - "Potappo", - "Shirasu" - ] - }, "Web/API/ChildNode/before": { "modified": "2020-10-17T03:58:22.731Z", "contributors": [ @@ -51810,6 +51802,14 @@ "maruhiro" ] }, + "orphaned/Web/API/ChildNode/after": { + "modified": "2020-10-17T21:33:51.563Z", + "contributors": [ + "dskmori", + "Potappo", + "Shirasu" + ] + }, "orphaned/Web/API/ChildNode/remove": { "modified": "2020-10-15T21:51:39.796Z", "contributors": [ diff --git a/files/ja/orphaned/web/api/childnode/after/index.html b/files/ja/orphaned/web/api/childnode/after/index.html new file mode 100644 index 0000000000..837ab99d5e --- /dev/null +++ b/files/ja/orphaned/web/api/childnode/after/index.html @@ -0,0 +1,185 @@ +--- +title: ChildNode.after() +slug: orphaned/Web/API/ChildNode/after +tags: + - API + - DOM + - Method + - Node + - Reference +translation_of: Web/API/ChildNode/after +original_slug: Web/API/ChildNode/after +--- +
{{APIRef("DOM")}}
+ +

ChildNode.after() は、ChildNode の親の子リストの、ChildNode の直後に、 {{domxref("Node")}} または {{domxref("DOMString")}} オブジェクトのセットを挿入します。 {{domxref("DOMString")}} オブジェクトは {{domxref("Text")}} ノードと等価なノードとして挿入されます。

+ +

構文

+ +
[Throws, Unscopable]
+void ChildNode.after((Node or DOMString)... nodes);
+
+ +

パラメーター

+ +
+
nodes
+
{{domxref("Node")}} または {{domxref("DOMString")}} オブジェクトのセットを挿入します。
+
+ +

例外

+ + + +

+ +

要素の挿入

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

テキストの挿入

+ +
var parent = document.createElement("div");
+var child = document.createElement("p");
+parent.appendChild(child);
+
+child.after("Text");
+
+console.log(parent.outerHTML);
+// "<div><p></p>Text</div>"
+ +

要素とテキストの挿入

+ +
var parent = document.createElement("div");
+var child = document.createElement("p");
+parent.appendChild(child);
+var span = document.createElement("span");
+
+child.after(span, "Text");
+
+console.log(parent.outerHTML);
+// "<div><p></p><span></span>Text</div>"
+ +

ChildNode.after() はスコーピングに非対応

+ +

after() メソッドは with 文でのスコーピングに対応していません。詳細は {{jsxref("Symbol.unscopables")}} をご覧ください。

+ +
with(node) {
+  after("foo");
+}
+// ReferenceError: after is not defined 
+ +

ポリフィル

+ +

以下のポリフィルで、Internet Explorer 9 以降でも after() メソッドが利用できます。

+ +
// from: https://github.com/jserz/js_piece/blob/master/DOM/ChildNode/after()/after().md
+(function (arr) {
+  arr.forEach(function (item) {
+    if (item.hasOwnProperty('after')) {
+      return;
+    }
+    Object.defineProperty(item, 'after', {
+      configurable: true,
+      enumerable: true,
+      writable: true,
+      value: function after() {
+        var argArr = Array.prototype.slice.call(arguments),
+          docFrag = document.createDocumentFragment();
+
+        argArr.forEach(function (argItem) {
+          var isNode = argItem instanceof Node;
+          docFrag.appendChild(isNode ? argItem : document.createTextNode(String(argItem)));
+        });
+
+        this.parentNode.insertBefore(docFrag, this.nextSibling);
+      }
+    });
+  });
+})([Element.prototype, CharacterData.prototype, DocumentType.prototype]);
+ +

別のポリフィル

+ +
// from: https://github.com/FabioVergani/js-Polyfill_Element.prototype.after/blob/master/after.js
+
+(function(x){
+ var o=x.prototype,p='after';
+ if(!o[p]){
+    o[p]=function(){
+     var e, m=arguments, l=m.length, i=0, t=this, p=t.parentNode, n=Node, s=String, d=document;
+     if(p!==null){
+        while(i<l){
+         e=m[i];
+         if(e instanceof n){
+            t=t.nextSibling;
+            if(t!==null){
+                p.insertBefore(e,t);
+            }else{
+                p.appendChild(e);
+            };
+         }else{
+            p.appendChild(d.createTextNode(s(e)));
+         };
+         ++i;
+        };
+     };
+    };
+ };
+})(Element);
+
+
+
+/*
+minified:
+
+(function(x){
+ var o=x.prototype;
+ o.after||(o.after=function(){var e,m=arguments,l=m.length,i=0,t=this,p=t.parentNode,n=Node,s=String,d=document;if(p!==null){while(i<l){((e=m[i]) instanceof n)?(((t=t.nextSibling )!==null)?p.insertBefore(e,t):p.appendChild(e)):p.appendChild(d.createTextNode(s(e)));++i;}}});
+}(Element));
+*/
+
+ +

仕様

+ + + + + + + + + + + + + + +
仕様書策定状況コメント
{{SpecName('DOM WHATWG', '#dom-childnode-after', 'ChildNode.after()')}}{{Spec2('DOM WHATWG')}}初期定義
+ +

ブラウザー実装状況

+ + + +

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

+ +

関連情報

+ + diff --git a/files/ja/web/api/childnode/after/index.html b/files/ja/web/api/childnode/after/index.html deleted file mode 100644 index 8f29bb44f3..0000000000 --- a/files/ja/web/api/childnode/after/index.html +++ /dev/null @@ -1,184 +0,0 @@ ---- -title: ChildNode.after() -slug: Web/API/ChildNode/after -tags: - - API - - DOM - - Method - - Node - - Reference -translation_of: Web/API/ChildNode/after ---- -
{{APIRef("DOM")}}
- -

ChildNode.after() は、ChildNode の親の子リストの、ChildNode の直後に、 {{domxref("Node")}} または {{domxref("DOMString")}} オブジェクトのセットを挿入します。 {{domxref("DOMString")}} オブジェクトは {{domxref("Text")}} ノードと等価なノードとして挿入されます。

- -

構文

- -
[Throws, Unscopable]
-void ChildNode.after((Node or DOMString)... nodes);
-
- -

パラメーター

- -
-
nodes
-
{{domxref("Node")}} または {{domxref("DOMString")}} オブジェクトのセットを挿入します。
-
- -

例外

- - - -

- -

要素の挿入

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

テキストの挿入

- -
var parent = document.createElement("div");
-var child = document.createElement("p");
-parent.appendChild(child);
-
-child.after("Text");
-
-console.log(parent.outerHTML);
-// "<div><p></p>Text</div>"
- -

要素とテキストの挿入

- -
var parent = document.createElement("div");
-var child = document.createElement("p");
-parent.appendChild(child);
-var span = document.createElement("span");
-
-child.after(span, "Text");
-
-console.log(parent.outerHTML);
-// "<div><p></p><span></span>Text</div>"
- -

ChildNode.after() はスコーピングに非対応

- -

after() メソッドは with 文でのスコーピングに対応していません。詳細は {{jsxref("Symbol.unscopables")}} をご覧ください。

- -
with(node) {
-  after("foo");
-}
-// ReferenceError: after is not defined 
- -

ポリフィル

- -

以下のポリフィルで、Internet Explorer 9 以降でも after() メソッドが利用できます。

- -
// from: https://github.com/jserz/js_piece/blob/master/DOM/ChildNode/after()/after().md
-(function (arr) {
-  arr.forEach(function (item) {
-    if (item.hasOwnProperty('after')) {
-      return;
-    }
-    Object.defineProperty(item, 'after', {
-      configurable: true,
-      enumerable: true,
-      writable: true,
-      value: function after() {
-        var argArr = Array.prototype.slice.call(arguments),
-          docFrag = document.createDocumentFragment();
-
-        argArr.forEach(function (argItem) {
-          var isNode = argItem instanceof Node;
-          docFrag.appendChild(isNode ? argItem : document.createTextNode(String(argItem)));
-        });
-
-        this.parentNode.insertBefore(docFrag, this.nextSibling);
-      }
-    });
-  });
-})([Element.prototype, CharacterData.prototype, DocumentType.prototype]);
- -

別のポリフィル

- -
// from: https://github.com/FabioVergani/js-Polyfill_Element.prototype.after/blob/master/after.js
-
-(function(x){
- var o=x.prototype,p='after';
- if(!o[p]){
-    o[p]=function(){
-     var e, m=arguments, l=m.length, i=0, t=this, p=t.parentNode, n=Node, s=String, d=document;
-     if(p!==null){
-        while(i<l){
-         e=m[i];
-         if(e instanceof n){
-            t=t.nextSibling;
-            if(t!==null){
-                p.insertBefore(e,t);
-            }else{
-                p.appendChild(e);
-            };
-         }else{
-            p.appendChild(d.createTextNode(s(e)));
-         };
-         ++i;
-        };
-     };
-    };
- };
-})(Element);
-
-
-
-/*
-minified:
-
-(function(x){
- var o=x.prototype;
- o.after||(o.after=function(){var e,m=arguments,l=m.length,i=0,t=this,p=t.parentNode,n=Node,s=String,d=document;if(p!==null){while(i<l){((e=m[i]) instanceof n)?(((t=t.nextSibling )!==null)?p.insertBefore(e,t):p.appendChild(e)):p.appendChild(d.createTextNode(s(e)));++i;}}});
-}(Element));
-*/
-
- -

仕様

- - - - - - - - - - - - - - -
仕様書策定状況コメント
{{SpecName('DOM WHATWG', '#dom-childnode-after', 'ChildNode.after()')}}{{Spec2('DOM WHATWG')}}初期定義
- -

ブラウザー実装状況

- - - -

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

- -

関連情報

- - diff --git a/files/pt-br/_redirects.txt b/files/pt-br/_redirects.txt index 5cdcfc9164..c4d180ca86 100644 --- a/files/pt-br/_redirects.txt +++ b/files/pt-br/_redirects.txt @@ -541,6 +541,7 @@ /pt-BR/docs/Web/API/BatteryManager.ondischargingtimechange /pt-BR/docs/Web/API/BatteryManager/ondischargingtimechange /pt-BR/docs/Web/API/BatteryManager.onlevelchange /pt-BR/docs/Web/API/BatteryManager/onlevelchange /pt-BR/docs/Web/API/BatteryManager/ondischargintimechange /pt-BR/docs/Web/API/BatteryManager/ondischargingtimechange +/pt-BR/docs/Web/API/ChildNode/after /pt-BR/docs/orphaned/Web/API/ChildNode/after /pt-BR/docs/Web/API/ChildNode/remove /pt-BR/docs/orphaned/Web/API/ChildNode/remove /pt-BR/docs/Web/API/Console.timeEnd /pt-BR/docs/Web/API/Console/timeEnd /pt-BR/docs/Web/API/Coordinates /pt-BR/docs/Web/API/GeolocationCoordinates diff --git a/files/pt-br/_wikihistory.json b/files/pt-br/_wikihistory.json index 0cc1926851..4db23eb93c 100644 --- a/files/pt-br/_wikihistory.json +++ b/files/pt-br/_wikihistory.json @@ -4090,12 +4090,6 @@ "stevenwdv" ] }, - "Web/API/ChildNode/after": { - "modified": "2020-10-15T22:17:31.621Z", - "contributors": [ - "pedroguilhermelima" - ] - }, "Web/API/ClipboardEvent": { "modified": "2020-10-15T22:15:35.028Z", "contributors": [ @@ -17001,6 +16995,12 @@ "andre-mendes" ] }, + "orphaned/Web/API/ChildNode/after": { + "modified": "2020-10-15T22:17:31.621Z", + "contributors": [ + "pedroguilhermelima" + ] + }, "orphaned/Web/API/ChildNode/remove": { "modified": "2020-10-15T21:55:19.824Z", "contributors": [ diff --git a/files/pt-br/orphaned/web/api/childnode/after/index.html b/files/pt-br/orphaned/web/api/childnode/after/index.html new file mode 100644 index 0000000000..8fa84d11ee --- /dev/null +++ b/files/pt-br/orphaned/web/api/childnode/after/index.html @@ -0,0 +1,186 @@ +--- +title: ChildNode.after() +slug: orphaned/Web/API/ChildNode/after +tags: + - API + - DOM + - Experimental + - Nó + - Referencia + - metodo +translation_of: Web/API/ChildNode/after +original_slug: Web/API/ChildNode/after +--- +
{{APIRef("DOM")}} {{SeeCompatTable}}
+ +

The ChildNode.after() method inserts a set of {{domxref("Node")}} or {{domxref("DOMString")}} objects in the children list of this ChildNode's parent, just after this ChildNode. {{domxref("DOMString")}} objects are inserted as equivalent {{domxref("Text")}} nodes.

+ +

Sintaxe

+ +
[Throws, Unscopable]
+void ChildNode.after((Node or DOMString)... nodes);
+
+ +

Parâmetros

+ +
+
nós
+
A set of {{domxref("Node")}} or {{domxref("DOMString")}} objects to insert.
+
+ +

Exceções

+ + + +

Exemplos

+ +

Inserindo uum elemento

+ +
var parente = document.createElement("div");
+var filho = document.createElement("p");
+parente.appendChild(filho);
+var span = document.createElement("span");
+
+filho.after(span);
+
+console.log(parente.outerHTML);
+// "<div><p></p><span></span></div>"
+
+ +

Inserindo texto

+ +
var parente = document.createElement("div");
+var filho = document.createElement("p");
+parente.appendChild(filho);
+
+filho.after("Text");
+
+console.log(parente.outerHTML);
+// "<div><p></p>Text</div>"
+ +

Inserindo um elemento e um texto 

+ +
var parente = document.createElement("div");
+var filho = document.createElement("p");
+parente.appendChild(filho);
+var span = document.createElement("span");
+
+filho.after(span, "Text");
+
+console.log(parente.outerHTML);
+// "<div><p></p><span></span>Text</div>"
+ +

ChildNode.after() is unscopable

+ +

The after() method is not scoped into the with statement. Veja {{jsxref("Symbol.unscopables")}} para maior infomação.

+ +
with(node) {
+  after("foo");
+}
+// ReferenceError: after is not defined 
+ +

Polyfill

+ +

Você pode usar polyfill com  o método  after()  no Internet Explorer 9 e com o seguinte código:

+ +
//from: https://github.com/jserz/js_piece/blob/master/DOM/ChildNode/after()/after().md
+(function (arr) {
+  arr.forEach(function (item) {
+    if (item.hasOwnProperty('after')) {
+      return;
+    }
+    Object.defineProperty(item, 'after', {
+      configurable: true,
+      enumerable: true,
+      writable: true,
+      value: function after() {
+        var argArr = Array.prototype.slice.call(arguments),
+          docFrag = document.createDocumentFragment();
+
+        argArr.forEach(function (argItem) {
+          var isNode = argItem instanceof Node;
+          docFrag.appendChild(isNode ? argItem : document.createTextNode(String(argItem)));
+        });
+
+        this.parentNode.insertBefore(docFrag, this.nextSibling);
+      }
+    });
+  });
+})([Element.prototype, CharacterData.prototype, DocumentType.prototype]);
+ +

 

+ +
//https://github.com/FabioVergani/js-Polyfill_Element.prototype.after/blob/master/after.js
+
+(function(x){
+ var o=x.prototype,p='after';
+ if(!o[p]){
+    o[p]=function(){
+     var e, m=arguments, l=m.length, i=0, t=this, p=t.parentNode, n=Node, s=String, d=document;
+     if(p!==null){
+        while(i<l){
+         e=m[i];
+         if(e instanceof n){
+            t=t.nextSibling;
+            if(t!==null){
+                p.insertBefore(e,t);
+            }else{
+                p.appendChild(e);
+            };
+         }else{
+            p.appendChild(d.createTextNode(s(e)));
+         };
+         ++i;
+        };
+     };
+    };
+ };
+})(Element);
+
+
+
+/*
+min:
+
+(function(x){
+ var o=x.prototype;
+ o.after||(o.after=function(){var e,m=arguments,l=m.length,i=0,t=this,p=t.parentNode,n=Node,s=String,d=document;if(p!==null){while(i<l){((e=m[i]) instanceof n)?(((t=t.nextSibling )!==null)?p.insertBefore(e,t):p.appendChild(e)):p.appendChild(d.createTextNode(s(e)));++i;}}});
+}(Element));
+
+*/
+
+ +

 

+ +

Especificação

+ + + + + + + + + + + + + + +
EspecificaçãoStatusComentário
{{SpecName('DOM WHATWG', '#dom-childnode-after', 'ChildNode.after()')}}{{Spec2('DOM WHATWG')}}Initial definition.
+ +

Compatibilidade com navegadores

+ +

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

+ +

Veja mais

+ + diff --git a/files/pt-br/web/api/childnode/after/index.html b/files/pt-br/web/api/childnode/after/index.html deleted file mode 100644 index 9f90cf31ea..0000000000 --- a/files/pt-br/web/api/childnode/after/index.html +++ /dev/null @@ -1,185 +0,0 @@ ---- -title: ChildNode.after() -slug: Web/API/ChildNode/after -tags: - - API - - DOM - - Experimental - - Nó - - Referencia - - metodo -translation_of: Web/API/ChildNode/after ---- -
{{APIRef("DOM")}} {{SeeCompatTable}}
- -

The ChildNode.after() method inserts a set of {{domxref("Node")}} or {{domxref("DOMString")}} objects in the children list of this ChildNode's parent, just after this ChildNode. {{domxref("DOMString")}} objects are inserted as equivalent {{domxref("Text")}} nodes.

- -

Sintaxe

- -
[Throws, Unscopable]
-void ChildNode.after((Node or DOMString)... nodes);
-
- -

Parâmetros

- -
-
nós
-
A set of {{domxref("Node")}} or {{domxref("DOMString")}} objects to insert.
-
- -

Exceções

- - - -

Exemplos

- -

Inserindo uum elemento

- -
var parente = document.createElement("div");
-var filho = document.createElement("p");
-parente.appendChild(filho);
-var span = document.createElement("span");
-
-filho.after(span);
-
-console.log(parente.outerHTML);
-// "<div><p></p><span></span></div>"
-
- -

Inserindo texto

- -
var parente = document.createElement("div");
-var filho = document.createElement("p");
-parente.appendChild(filho);
-
-filho.after("Text");
-
-console.log(parente.outerHTML);
-// "<div><p></p>Text</div>"
- -

Inserindo um elemento e um texto 

- -
var parente = document.createElement("div");
-var filho = document.createElement("p");
-parente.appendChild(filho);
-var span = document.createElement("span");
-
-filho.after(span, "Text");
-
-console.log(parente.outerHTML);
-// "<div><p></p><span></span>Text</div>"
- -

ChildNode.after() is unscopable

- -

The after() method is not scoped into the with statement. Veja {{jsxref("Symbol.unscopables")}} para maior infomação.

- -
with(node) {
-  after("foo");
-}
-// ReferenceError: after is not defined 
- -

Polyfill

- -

Você pode usar polyfill com  o método  after()  no Internet Explorer 9 e com o seguinte código:

- -
//from: https://github.com/jserz/js_piece/blob/master/DOM/ChildNode/after()/after().md
-(function (arr) {
-  arr.forEach(function (item) {
-    if (item.hasOwnProperty('after')) {
-      return;
-    }
-    Object.defineProperty(item, 'after', {
-      configurable: true,
-      enumerable: true,
-      writable: true,
-      value: function after() {
-        var argArr = Array.prototype.slice.call(arguments),
-          docFrag = document.createDocumentFragment();
-
-        argArr.forEach(function (argItem) {
-          var isNode = argItem instanceof Node;
-          docFrag.appendChild(isNode ? argItem : document.createTextNode(String(argItem)));
-        });
-
-        this.parentNode.insertBefore(docFrag, this.nextSibling);
-      }
-    });
-  });
-})([Element.prototype, CharacterData.prototype, DocumentType.prototype]);
- -

 

- -
//https://github.com/FabioVergani/js-Polyfill_Element.prototype.after/blob/master/after.js
-
-(function(x){
- var o=x.prototype,p='after';
- if(!o[p]){
-    o[p]=function(){
-     var e, m=arguments, l=m.length, i=0, t=this, p=t.parentNode, n=Node, s=String, d=document;
-     if(p!==null){
-        while(i<l){
-         e=m[i];
-         if(e instanceof n){
-            t=t.nextSibling;
-            if(t!==null){
-                p.insertBefore(e,t);
-            }else{
-                p.appendChild(e);
-            };
-         }else{
-            p.appendChild(d.createTextNode(s(e)));
-         };
-         ++i;
-        };
-     };
-    };
- };
-})(Element);
-
-
-
-/*
-min:
-
-(function(x){
- var o=x.prototype;
- o.after||(o.after=function(){var e,m=arguments,l=m.length,i=0,t=this,p=t.parentNode,n=Node,s=String,d=document;if(p!==null){while(i<l){((e=m[i]) instanceof n)?(((t=t.nextSibling )!==null)?p.insertBefore(e,t):p.appendChild(e)):p.appendChild(d.createTextNode(s(e)));++i;}}});
-}(Element));
-
-*/
-
- -

 

- -

Especificação

- - - - - - - - - - - - - - -
EspecificaçãoStatusComentário
{{SpecName('DOM WHATWG', '#dom-childnode-after', 'ChildNode.after()')}}{{Spec2('DOM WHATWG')}}Initial definition.
- -

Compatibilidade com navegadores

- -

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

- -

Veja mais

- - diff --git a/files/zh-cn/_redirects.txt b/files/zh-cn/_redirects.txt index 42a485d721..4b100a3e17 100644 --- a/files/zh-cn/_redirects.txt +++ b/files/zh-cn/_redirects.txt @@ -1470,6 +1470,7 @@ /zh-CN/docs/Web/API/Channel_Messaging_API/使用_channel_messaging /zh-CN/docs/Web/API/Channel_Messaging_API/Using_channel_messaging /zh-CN/docs/Web/API/ChildNode.nextElementSibling /zh-CN/docs/Web/API/Element/nextElementSibling /zh-CN/docs/Web/API/ChildNode.remove /zh-CN/docs/orphaned/Web/API/ChildNode/remove +/zh-CN/docs/Web/API/ChildNode/after /zh-CN/docs/orphaned/Web/API/ChildNode/after /zh-CN/docs/Web/API/ChildNode/remove /zh-CN/docs/orphaned/Web/API/ChildNode/remove /zh-CN/docs/Web/API/ChildNode/replaceWith /zh-CN/docs/orphaned/Web/API/ChildNode/replaceWith /zh-CN/docs/Web/API/Childnode.previousElementSibling /zh-CN/docs/Web/API/Element/previousElementSibling @@ -1737,6 +1738,7 @@ /zh-CN/docs/Web/API/NonDocumentTypeChildNode/previousElementSibling /zh-CN/docs/Web/API/Element/previousElementSibling /zh-CN/docs/Web/API/Notation /zh-CN/docs/orphaned/Web/API/Notation /zh-CN/docs/Web/API/OfflineAudioContext/complete /zh-CN/docs/Web/API/OfflineAudioContext/complete_event +/zh-CN/docs/Web/API/OscillatorNode/stop /zh-CN/docs/orphaned/Web/API/OscillatorNode/stop /zh-CN/docs/Web/API/ParentNode /zh-CN/docs/orphaned/Web/API/ParentNode /zh-CN/docs/Web/API/ParentNode.childElementCount /zh-CN/docs/Web/API/Element/childElementCount /zh-CN/docs/Web/API/ParentNode.children /zh-CN/docs/orphaned/Web/API/ParentNode/children diff --git a/files/zh-cn/_wikihistory.json b/files/zh-cn/_wikihistory.json index eb8aaa18d2..f804e5262b 100644 --- a/files/zh-cn/_wikihistory.json +++ b/files/zh-cn/_wikihistory.json @@ -9726,13 +9726,6 @@ "AlexChao" ] }, - "Web/API/ChildNode/after": { - "modified": "2020-10-15T21:51:08.472Z", - "contributors": [ - "Ende93", - "Cattla" - ] - }, "Web/API/ChildNode/before": { "modified": "2019-03-23T22:12:22.842Z", "contributors": [ @@ -18676,12 +18669,6 @@ "Nonym" ] }, - "Web/API/OscillatorNode/stop": { - "modified": "2019-03-23T22:09:45.455Z", - "contributors": [ - "boolean111000" - ] - }, "Web/API/PageTransitionEvent": { "modified": "2019-04-28T22:02:49.952Z", "contributors": [ @@ -49814,6 +49801,13 @@ "smilewalker" ] }, + "orphaned/Web/API/ChildNode/after": { + "modified": "2020-10-15T21:51:08.472Z", + "contributors": [ + "Ende93", + "Cattla" + ] + }, "orphaned/Web/API/ChildNode/remove": { "modified": "2020-10-15T21:27:27.352Z", "contributors": [ @@ -50008,6 +50002,12 @@ "xiaoxingchi" ] }, + "orphaned/Web/API/OscillatorNode/stop": { + "modified": "2019-03-23T22:09:45.455Z", + "contributors": [ + "boolean111000" + ] + }, "orphaned/Web/API/ParentNode": { "modified": "2020-10-15T21:30:05.597Z", "contributors": [ diff --git a/files/zh-cn/orphaned/web/api/childnode/after/index.html b/files/zh-cn/orphaned/web/api/childnode/after/index.html new file mode 100644 index 0000000000..76792e7638 --- /dev/null +++ b/files/zh-cn/orphaned/web/api/childnode/after/index.html @@ -0,0 +1,176 @@ +--- +title: ChildNode.after() +slug: orphaned/Web/API/ChildNode/after +translation_of: Web/API/ChildNode/after +original_slug: Web/API/ChildNode/after +--- +
{{APIRef("DOM")}}
+ +

ChildNode.after() 方法会在其父节点的子节点列表中插入一些 {{domxref("Node")}} 或 {{domxref("DOMString")}} 对象。插入位置为该节点之后。{{domxref("DOMString")}} 对象会被以 {{domxref("Text")}} 的形式插入。

+ +

语法

+ +
[Throws, Unscopable]
+void ChildNode.after((Node or DOMString)... nodes);
+
+ +

参数

+ +
+
nodes
+
一组准备插入的 {{domxref("Node")}} 或 {{domxref("DOMString")}} 。
+
+ +

错误

+ + + +

示例

+ +

插入元素

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

插入文本

+ +
var parent = document.createElement("div");
+var child = document.createElement("p");
+parent.appendChild(child);
+
+child.after("Text");
+
+console.log(parent.outerHTML);
+// "<div><p></p>Text</div>"
+ +

同时插入元素和文本

+ +
var parent = document.createElement("div");
+var child = document.createElement("p");
+parent.appendChild(child);
+var span = document.createElement("span");
+
+child.after(span, "Text");
+
+console.log(parent.outerHTML);
+// "<div><p></p><span></span>Text</div>"
+ +

ChildNode.after() 会被 with 环境排除

+ +

after() 方法不在 with 环境的范围内,可以查看 {{jsxref("Symbol.unscopables")}} 来了解更多信息。

+ +
with(node) {
+  after("foo");
+}
+// ReferenceError: after is not defined 
+ +

Polyfill

+ +

You can polyfill the after() method in Internet Explorer 9 and higher with the following code:

+ +
// from: https://github.com/jserz/js_piece/blob/master/DOM/ChildNode/after()/after().md
+(function (arr) {
+  arr.forEach(function (item) {
+    if (item.hasOwnProperty('after')) {
+      return;
+    }
+    Object.defineProperty(item, 'after', {
+      configurable: true,
+      enumerable: true,
+      writable: true,
+      value: function after() {
+        var argArr = Array.prototype.slice.call(arguments),
+          docFrag = document.createDocumentFragment();
+
+        argArr.forEach(function (argItem) {
+          var isNode = argItem instanceof Node;
+          docFrag.appendChild(isNode ? argItem : document.createTextNode(String(argItem)));
+        });
+
+        this.parentNode.insertBefore(docFrag, this.nextSibling);
+      }
+    });
+  });
+})([Element.prototype, CharacterData.prototype, DocumentType.prototype]);
+ +

Another polyfill

+ +
// from: https://github.com/FabioVergani/js-Polyfill_Element.prototype.after/blob/master/after.js
+
+(function(x){
+ var o=x.prototype,p='after';
+ if(!o[p]){
+    o[p]=function(){
+     var e, m=arguments, l=m.length, i=0, t=this, p=t.parentNode, n=Node, s=String, d=document;
+     if(p!==null){
+        while(i<l){
+         e=m[i];
+         if(e instanceof n){
+            t=t.nextSibling;
+            if(t!==null){
+                p.insertBefore(e,t);
+            }else{
+                p.appendChild(e);
+            };
+         }else{
+            p.appendChild(d.createTextNode(s(e)));
+         };
+         ++i;
+        };
+     };
+    };
+ };
+})(Element);
+
+
+
+/*
+minified:
+
+(function(x){
+ var o=x.prototype;
+ o.after||(o.after=function(){var e,m=arguments,l=m.length,i=0,t=this,p=t.parentNode,n=Node,s=String,d=document;if(p!==null){while(i<l){((e=m[i]) instanceof n)?(((t=t.nextSibling )!==null)?p.insertBefore(e,t):p.appendChild(e)):p.appendChild(d.createTextNode(s(e)));++i;}}});
+}(Element));
+*/
+ +

规范

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('DOM WHATWG', '#dom-childnode-after', 'ChildNode.after()')}}{{Spec2('DOM WHATWG')}}Initial definition.
+ +

浏览器兼容性

+ +

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

+ +

相关链接

+ + diff --git a/files/zh-cn/orphaned/web/api/oscillatornode/stop/index.html b/files/zh-cn/orphaned/web/api/oscillatornode/stop/index.html new file mode 100644 index 0000000000..be94b576e6 --- /dev/null +++ b/files/zh-cn/orphaned/web/api/oscillatornode/stop/index.html @@ -0,0 +1,122 @@ +--- +title: OscillatorNode.stop() +slug: orphaned/Web/API/OscillatorNode/stop +translation_of: Web/API/OscillatorNode/stop +original_slug: Web/API/OscillatorNode/stop +--- +

{{ APIRef("Web Audio API") }}

+ +
+

这个 stop方法 {{ domxref("OscillatorNode") }} 接口在指定时间内停止播放,它的参数是可选的,默认情况下是0.

+
+ +

语法

+ +
oscillator.stop(when); // stop playing oscillator at when
+ +

参数

+ +
+
when
+
An optional double representing the audio context time when the oscillator should stop. If a value is not included, it defaults to 0. If the time is equal to or before the current audio context time, the oscillator will stop playing immediately.
+
+ +

例如

+ +

下面的示例显示一个基本用法{{ domxref("AudioContext") }}创建子节点。一个应用的例子,看看我们的演示( Violent Theremin demo (see app.js for relevant code).

+ +
// create web audio api context
+var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
+
+// create Oscillator node
+var oscillator = audioCtx.createOscillator();
+oscillator.connect(audioCtx.destination);
+
+oscillator.start();
+
+oscillator.stop(audioCtx.currentTime + 2); // stop 2 seconds after the current time
+
+ +

规定

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Web Audio API', '#widl-OscillatorNode-stop-void-double-when', 'stop')}}{{Spec2('Web Audio API')}} 
+ +

浏览器的兼容性

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support14 {{property_prefix("webkit")}}{{CompatVersionUnknown}}23 [1]{{CompatNo}}15 {{property_prefix("webkit")}}
+ 22 (unprefixed)
6 {{property_prefix("webkit")}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidChromeEdgeFirefox Mobile (Gecko)Firefox OSIE PhoneOpera MobileSafari Mobile
Basic support{{CompatNo}}{{CompatVersionUnknown}}28 {{property_prefix("webkit")}}25 [1]1.2{{CompatNo}}{{CompatNo}}6 {{property_prefix("webkit")}}
+
+ +

[1] The parameter wasn't optional until Firefox 30.

+ +

See also

+ + diff --git a/files/zh-cn/web/api/childnode/after/index.html b/files/zh-cn/web/api/childnode/after/index.html deleted file mode 100644 index 9ae67b4815..0000000000 --- a/files/zh-cn/web/api/childnode/after/index.html +++ /dev/null @@ -1,175 +0,0 @@ ---- -title: ChildNode.after() -slug: Web/API/ChildNode/after -translation_of: Web/API/ChildNode/after ---- -
{{APIRef("DOM")}}
- -

ChildNode.after() 方法会在其父节点的子节点列表中插入一些 {{domxref("Node")}} 或 {{domxref("DOMString")}} 对象。插入位置为该节点之后。{{domxref("DOMString")}} 对象会被以 {{domxref("Text")}} 的形式插入。

- -

语法

- -
[Throws, Unscopable]
-void ChildNode.after((Node or DOMString)... nodes);
-
- -

参数

- -
-
nodes
-
一组准备插入的 {{domxref("Node")}} 或 {{domxref("DOMString")}} 。
-
- -

错误

- - - -

示例

- -

插入元素

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

插入文本

- -
var parent = document.createElement("div");
-var child = document.createElement("p");
-parent.appendChild(child);
-
-child.after("Text");
-
-console.log(parent.outerHTML);
-// "<div><p></p>Text</div>"
- -

同时插入元素和文本

- -
var parent = document.createElement("div");
-var child = document.createElement("p");
-parent.appendChild(child);
-var span = document.createElement("span");
-
-child.after(span, "Text");
-
-console.log(parent.outerHTML);
-// "<div><p></p><span></span>Text</div>"
- -

ChildNode.after() 会被 with 环境排除

- -

after() 方法不在 with 环境的范围内,可以查看 {{jsxref("Symbol.unscopables")}} 来了解更多信息。

- -
with(node) {
-  after("foo");
-}
-// ReferenceError: after is not defined 
- -

Polyfill

- -

You can polyfill the after() method in Internet Explorer 9 and higher with the following code:

- -
// from: https://github.com/jserz/js_piece/blob/master/DOM/ChildNode/after()/after().md
-(function (arr) {
-  arr.forEach(function (item) {
-    if (item.hasOwnProperty('after')) {
-      return;
-    }
-    Object.defineProperty(item, 'after', {
-      configurable: true,
-      enumerable: true,
-      writable: true,
-      value: function after() {
-        var argArr = Array.prototype.slice.call(arguments),
-          docFrag = document.createDocumentFragment();
-
-        argArr.forEach(function (argItem) {
-          var isNode = argItem instanceof Node;
-          docFrag.appendChild(isNode ? argItem : document.createTextNode(String(argItem)));
-        });
-
-        this.parentNode.insertBefore(docFrag, this.nextSibling);
-      }
-    });
-  });
-})([Element.prototype, CharacterData.prototype, DocumentType.prototype]);
- -

Another polyfill

- -
// from: https://github.com/FabioVergani/js-Polyfill_Element.prototype.after/blob/master/after.js
-
-(function(x){
- var o=x.prototype,p='after';
- if(!o[p]){
-    o[p]=function(){
-     var e, m=arguments, l=m.length, i=0, t=this, p=t.parentNode, n=Node, s=String, d=document;
-     if(p!==null){
-        while(i<l){
-         e=m[i];
-         if(e instanceof n){
-            t=t.nextSibling;
-            if(t!==null){
-                p.insertBefore(e,t);
-            }else{
-                p.appendChild(e);
-            };
-         }else{
-            p.appendChild(d.createTextNode(s(e)));
-         };
-         ++i;
-        };
-     };
-    };
- };
-})(Element);
-
-
-
-/*
-minified:
-
-(function(x){
- var o=x.prototype;
- o.after||(o.after=function(){var e,m=arguments,l=m.length,i=0,t=this,p=t.parentNode,n=Node,s=String,d=document;if(p!==null){while(i<l){((e=m[i]) instanceof n)?(((t=t.nextSibling )!==null)?p.insertBefore(e,t):p.appendChild(e)):p.appendChild(d.createTextNode(s(e)));++i;}}});
-}(Element));
-*/
- -

规范

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('DOM WHATWG', '#dom-childnode-after', 'ChildNode.after()')}}{{Spec2('DOM WHATWG')}}Initial definition.
- -

浏览器兼容性

- -

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

- -

相关链接

- - diff --git a/files/zh-cn/web/api/oscillatornode/stop/index.html b/files/zh-cn/web/api/oscillatornode/stop/index.html deleted file mode 100644 index 3b776727b6..0000000000 --- a/files/zh-cn/web/api/oscillatornode/stop/index.html +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: OscillatorNode.stop() -slug: Web/API/OscillatorNode/stop -translation_of: Web/API/OscillatorNode/stop ---- -

{{ APIRef("Web Audio API") }}

- -
-

这个 stop方法 {{ domxref("OscillatorNode") }} 接口在指定时间内停止播放,它的参数是可选的,默认情况下是0.

-
- -

语法

- -
oscillator.stop(when); // stop playing oscillator at when
- -

参数

- -
-
when
-
An optional double representing the audio context time when the oscillator should stop. If a value is not included, it defaults to 0. If the time is equal to or before the current audio context time, the oscillator will stop playing immediately.
-
- -

例如

- -

下面的示例显示一个基本用法{{ domxref("AudioContext") }}创建子节点。一个应用的例子,看看我们的演示( Violent Theremin demo (see app.js for relevant code).

- -
// create web audio api context
-var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
-
-// create Oscillator node
-var oscillator = audioCtx.createOscillator();
-oscillator.connect(audioCtx.destination);
-
-oscillator.start();
-
-oscillator.stop(audioCtx.currentTime + 2); // stop 2 seconds after the current time
-
- -

规定

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('Web Audio API', '#widl-OscillatorNode-stop-void-double-when', 'stop')}}{{Spec2('Web Audio API')}} 
- -

浏览器的兼容性

- -
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support14 {{property_prefix("webkit")}}{{CompatVersionUnknown}}23 [1]{{CompatNo}}15 {{property_prefix("webkit")}}
- 22 (unprefixed)
6 {{property_prefix("webkit")}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChromeEdgeFirefox Mobile (Gecko)Firefox OSIE PhoneOpera MobileSafari Mobile
Basic support{{CompatNo}}{{CompatVersionUnknown}}28 {{property_prefix("webkit")}}25 [1]1.2{{CompatNo}}{{CompatNo}}6 {{property_prefix("webkit")}}
-
- -

[1] The parameter wasn't optional until Firefox 30.

- -

See also

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