diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:42:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:42:17 -0500 |
commit | da78a9e329e272dedb2400b79a3bdeebff387d47 (patch) | |
tree | e6ef8aa7c43556f55ddfe031a01cf0a8fa271bfe /files/it/web/api/document/importnode | |
parent | 1109132f09d75da9a28b649c7677bb6ce07c40c0 (diff) | |
download | translated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.tar.gz translated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.tar.bz2 translated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.zip |
initial commit
Diffstat (limited to 'files/it/web/api/document/importnode')
-rw-r--r-- | files/it/web/api/document/importnode/index.html | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/files/it/web/api/document/importnode/index.html b/files/it/web/api/document/importnode/index.html new file mode 100644 index 0000000000..354db3c0c8 --- /dev/null +++ b/files/it/web/api/document/importnode/index.html @@ -0,0 +1,45 @@ +--- +title: document.importNode +slug: Web/API/Document/importNode +translation_of: Web/API/Document/importNode +--- +<div>{{APIRef("DOM")}}</div> + +<p>Restituisce un clone di un nodo preso da un documento esterno.</p> + +<h3 id="Sintassi" name="Sintassi">Sintassi</h3> + +<pre class="eval"><i>nodo</i> = +<i>document</i>.importNode( +<i>nodoEsterno</i>, +<i>bool</i>) +</pre> + +<ul> + <li><code>nodo</code> è il nodo che verrà importato nel documento. Il + + <i>parentNode</i> + del nuovo nodo è <code>null</code>, perchè non è ancora stato inserito nell'albero del documento</li> + <li><code>nodoEsterno</code> è il nodo che verrà importato da un altro documento</li> + <li><code>bool</code> vale true o false. Se è true, il nodo verrà importato con tutti i suoi figli. Se è false, il nodo verrà importato senza i figli</li> +</ul> + +<h3 id="Esempio" name="Esempio">Esempio</h3> + +<pre class="eval">var iframe = document.getElementsByTagName("iframe")[0]; +var vecchioNodo = iframe.contentDocument.getElementById("mioNodo"); +var nuovoNodo = document.importNode(vecchioNodo,true); +document.getElementById("contenitore").appendChild(nuovoNodo); +</pre> + +<h3 id="Note" name="Note">Note</h3> + +<p>Il nodo non viene rimosso dal documento originale. Il nodo importato è un clone dell'originale. I nodi presi dai documenti esterni devono essere importati prima di poter essere inseriti nel documento corrente.</p> + +<p><a class="external" href="http://www.w3.org/DOM/faq.html#ownerdoc" rel="freelink">http://www.w3.org/DOM/faq.html#ownerdoc</a></p> + +<h3 id="Specifiche" name="Specifiche">Specifiche</h3> + +<p><a class="external" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#Core-Document-importNode">DOM Level 2 Core: Document.importNode</a></p> + +<p>{{ languages( { "fr": "fr/DOM/document.importNode" } ) }}</p> |