blob: 553cad8d0c7762a7219ea2978159a40b80dd973b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
---
title: Document.writeln()
slug: Web/API/Document/writeln
tags:
- API
- DOM
- Gecko
- Referencia
- metodo
translation_of: Web/API/Document/writeln
---
<div>{{ ApiRef("DOM") }}</div>
<p><span id="result_box" lang="pt"><span class="hps">Grava uma seqüência</span> <span class="hps">de</span> <span class="hps">texto</span><span>, seguido</span> <span class="hps">por um</span> <span class="hps">caractere de nova linha</span> <span class="hps">a um documento.</span></span></p>
<h2 id="Syntax" name="Syntax">Sintaxes</h2>
<pre class="eval">document.writeln(<em>line</em>);
</pre>
<h3 id="Parameters" name="Parameters">Parâmetros</h3>
<ul>
<li><code>line</code>
<div dir="ltr" style="zoom: 1;"><span class="short_text" id="result_box" lang="pt"><span class="hps">é uma string</span> <span class="hps">contendo</span> <span class="hps">uma linha de texto</span><span>.</span></span></div>
</li>
</ul>
<h2 id="Example" name="Example">Exemplo</h2>
<pre>document.writeln("<p>enter password:</p>");
</pre>
<h2 id="Notes" name="Notes">Notas</h2>
<p><strong>document.writeln</strong> <span class="short_text" id="result_box" lang="pt"><span class="hps">é</span> <span class="hps">o mesmo que</span></span> <a href="/en/DOM/document.write" title="en/DOM/document.write">document.write</a> <span class="short_text" id="result_box" lang="pt"><span class="hps">mas acrescenta</span> <span class="hps">uma nova linha.</span></span></p>
<div class="note"><strong>Note:</strong> <strong>document.writeln</strong> (like <strong>document.write</strong>) does not work in XHTML documents (you'll get a "Operation is not supported" (<code>NS_ERROR_DOM_NOT_SUPPORTED_ERR</code>) error on the error console). This is the case if opening a local file with a .xhtml file extension or for any document served with an application/xhtml+xml MIME type. More information is available in the <a class="external" href="http://www.w3.org/MarkUp/2004/xhtml-faq#docwrite">W3C XHTML FAQ</a>.</div>
<h2 id="Specification" name="Specification">Especificação</h2>
<p><a class="external" href="http://www.w3.org/TR/2000/WD-DOM-Level-2-HTML-20001113/html.html#ID-35318390">writeln </a></p>
|