Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
AppendChild() behavior on div
Message
De
15/03/2016 15:16:25
 
 
À
15/03/2016 14:24:33
Information générale
Forum:
Javascript
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01633130
Message ID:
01633138
Vues:
68
This message has been marked as the solution to the initial question of the thread.
>I would like to verify something in regards to how the appendChild() works.
>
>I have this code:
>
>
>oDiv=toIFrame.document.getElementById(tcDiv)
>document.body.appendChild(oDiv)
>
>
>When this executes, oDiv is a reference to another document for a div object.
>
>The next line appends the master document with that div Html code.
>
>However, appendChild() destroys the object on the other document.
>
>What can I do to prevent that?
oDiv = toIFrame.document.getElementById(tcDiv).cloneNode(true);

document.body.appendChild(oDiv);
----------------------------------
António Tavares Lopes
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform