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/open/index.html | |
| 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/open/index.html')
| -rw-r--r-- | files/it/web/api/document/open/index.html | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/files/it/web/api/document/open/index.html b/files/it/web/api/document/open/index.html new file mode 100644 index 0000000000..7f4c1eb77a --- /dev/null +++ b/files/it/web/api/document/open/index.html @@ -0,0 +1,46 @@ +--- +title: document.open +slug: Web/API/Document/open +tags: + - DOM + - Gecko + - Reference_del_DOM_di_Gecko + - Tutte_le_categorie +translation_of: Web/API/Document/open +--- +<div>{{APIRef("DOM")}}</div> + +<p>Il metodo <code>document.open()</code> apre un documento in <a href="it/DOM/document.write">scrittura</a> (document.write()).</p> + +<h3 id="Sintassi" name="Sintassi">Sintassi</h3> + +<pre class="eval">document.open(); +</pre> + +<h3 id="Esempio" name="Esempio">Esempio</h3> + +<pre>// In questo esempio, i contenuti del documento +// vengono sovrascritti quando il documento +// viene reinizializzato con open(). +document.write("<html><p>eliminami</p></html>"); +document.open(); +// il documento è vuoto +</pre> + +<h3 id="Note" name="Note">Note</h3> + +<p>Se un documento esiste, questo metodo lo svuota (si veda l'esempio sopra).</p> + +<p>Inoltre <code>document.open()</code> viene chiamato implicitamente quando si chiama <a href="it/DOM/document.write">document.write()</a> dopo che la pagina è stata caricata, nonostante ciò non sia richiesto dalle specifiche del W3C.</p> + +<p>Non confondere questo metodo con <a href="it/DOM/window.open">window.open()</a>. <code>document.open()</code> permette di sovrascrivere il documento corrente o aggiungere testo allo stesso, mentre <code>window.open</code> fornisce un modo per apreire una finestra, lasciando intatto il documento. Poiché <code>window</code> è l'oggetto globale, scrivere solamente <code>open(...)</code> fa la stessa cosa</p> + +<p>Puoi chiudere il documento aperto usando <a href="it/DOM/document.close">document.close()</a>.</p> + +<h3 id="Specification" name="Specification">Specificazioni</h3> + +<p><a class="external" href="http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-72161170">DOM Level 2 HTML: <code>open()</code> Method</a></p> + +<div class="noinclude"> </div> + +<p>{{ languages( { "fr": "fr/DOM/document.open", "ja": "ja/DOM/document.open", "pl": "pl/DOM/document.open" } ) }}</p> |
