diff options
Diffstat (limited to 'files/it/web/api/range/createcontextualfragment')
-rw-r--r-- | files/it/web/api/range/createcontextualfragment/index.html | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/files/it/web/api/range/createcontextualfragment/index.html b/files/it/web/api/range/createcontextualfragment/index.html new file mode 100644 index 0000000000..f56354ddc4 --- /dev/null +++ b/files/it/web/api/range/createcontextualfragment/index.html @@ -0,0 +1,37 @@ +--- +title: range.createContextualFragment +slug: Web/API/Range/createContextualFragment +translation_of: Web/API/Range/createContextualFragment +--- +<p>{{ APIRef("DOM") }}</p> + +<p>Restituisce un frammento di documento.</p> + +<h3 id="Sintassi" name="Sintassi">Sintassi</h3> + +<pre class="eval">frammento = range.createContextualFragment( tag ) +</pre> + +<h3 id="Parametri" name="Parametri">Parametri</h3> + +<dl> + <dt>tag </dt> + <dd>stringa che contiene del testo da convertire in un frammento di documento</dd> +</dl> + +<h3 id="Esempio" name="Esempio">Esempio</h3> + +<pre class="eval">var tag = "<div>Ciao, sono un nodo!</div>"; +var range = document.createRange(); +range.selectNode(document.getElementsByTagName("div").item(0)); +var frammento = range.createContextualFragment(tag); +document.body.appendChild(frammento); +</pre> + +<h3 id="Note" name="Note">Note</h3> + +<p>Questo metodo accetta una stringa e utilizza l'interprete di Mozilla per convertirla in un ramo (o un singolo nodo) del DOM.</p> + +<h3 id="Specifiche" name="Specifiche">Specifiche</h3> + +<p>DOM Level 0. Non è parte di alcuno standard.</p> |