From 99efa5cfa34c3f9d38b75352881acdfc99508ebf Mon Sep 17 00:00:00 2001 From: tristantheb Date: Fri, 2 Apr 2021 13:50:14 +0200 Subject: UPDATE: FR-ONLY - Remove all old CompatibilityTable to replace with {{Compat()}} (#311) * UPDATE: Removing CompatibilityTable script - Part 1 * UPDATE: Removing CompatibilityTable script - Part 2 * UPDATE: Removing CompatibilityTable script - Part 3 * UPDATE: Removing CompatibilityTable script - Part 4 * UPDATE: Removing CompatibilityTable script - Part 5/5 * FIX: Repair the EOL of one page * FIX: Fix conflicting file --- files/fr/web/api/node/replacechild/index.html | 137 +++++++++----------------- 1 file changed, 47 insertions(+), 90 deletions(-) (limited to 'files/fr/web/api/node/replacechild/index.html') diff --git a/files/fr/web/api/node/replacechild/index.html b/files/fr/web/api/node/replacechild/index.html index 2233bbd419..3fb6b0e8df 100644 --- a/files/fr/web/api/node/replacechild/index.html +++ b/files/fr/web/api/node/replacechild/index.html @@ -25,109 +25,66 @@ translation_of: Web/API/Node/replaceChild
  • replaceNode est le nœud remplacé. C'est le même nœud que oldChild.
  • -

    Exemple

    +

    Exemple

    -
    // <div>
    -//  <span id="childSpan">foo bar</span>
    -// </div>
    +
    // Étant donné que :
    +// <div>
    +//   <span id="childSpan">foo bar</span>
    +// </div>
     
    -// crée un noeud élément vide
    -// sans ID, aucun attribut ni contenu
    -var sp1 = document.createElement("span");
    +// Crée un nœud d'élément vide
    +// sans ID, sans attributs et sans contenu
    +var sp1 = document.createElement("span");
     
    -// lui donne un attribut id appelé 'newSpan'
    -sp1.id = "newSpan";
    +// Donne un attribut id appelé "newSpan"
    +sp1.id = "newSpan";
     
    -// crée un contenu pour le nouvel élément.
    -var sp1_content = document.createTextNode("new replacement span element.");
    +// Crée du contenu pour le nouvel élément
    +var sp1_content = document.createTextNode("nouvel élément span de remplacement.");
     
    -// applique ce contenu au nouvel élément
    -sp1.appendChild(sp1_content);
    +// Applique ce contenu au nouvel élément
    +sp1.appendChild(sp1_content);
     
    -// construit une référence au noeud existant devant être remplacé
    -var sp2 = document.getElementById("childSpan");
    -var parentDiv = sp2.parentNode;
    +// Construit une référence au nœud existant à remplacer
    +var sp2 = document.getElementById("childSpan");
    +var parentDiv = sp2.parentNode;
     
    -// remplace le noeud existant sp2 avec le nouvel élément span sp1
    -parentDiv.replaceChild(sp1, sp2);
    +// Remplacer le noeud existant sp2 par le nouvel élément span sp1
    +parentDiv.replaceChild(sp1, sp2);
     
    -// résultat :
    -// <div>
    -//   <span id="newSpan">nouvel élément span de remplacement.</span>
    -// </div>
    - -
     
    +// Résultat : +// <div> +// <span id="newSpan">nouvel élément span de remplacement.</span> +// </div> +
    -

    Spécifications

    +

    Spécifications

    + + + + + + + + + + + + + + + + +
    SpécificationStatutCommentaire
    {{SpecName("DOM WHATWG", "#dom-node-replacechild", "Node: replaceChild")}} + {{Spec2("DOM WHATWG")}}
    - +

    Compatibilité des navigateurs

    -

     

    - -

    Compatibilité des navigateurs

    - -

    {{CompatibilityTable}}

    - -
    - - - - - - - - - - - - - - - - - - - - - -
    FonctionnalitéChromeFirefox (Gecko)Internet ExplorerEdgeOperaSafari
    Basic support{{CompatChrome(1.0)}}{{CompatGeckoDesktop(1)}}    IE6 (Maybe Earlier){{CompatVersionUnknown}}{{CompatOpera(1.0)}}{{CompatVersionUnknown}}
    -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    FonctionnalitéAndroid WebviewFirefox Mobile (Gecko)IE MobileEdge MobileOpera MobileSafari MobileChrome for Android
    Basic support{{CompatVersionUnknown}}{{CompatGeckoMobile(1)}}IE6 (Maybe Earlier){{CompatVersionUnknown}}{{CompatOperaMobile(1.0)}}{{CompatVersionUnknown}}{{CompatChrome(1.0)}}
    -
    +

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

    -

    Voir aussi

    +

    Voir aussi

    - -

     

    -- cgit v1.2.3-54-g00ecf