diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/document/writeln | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/api/document/writeln')
-rw-r--r-- | files/zh-cn/web/api/document/writeln/index.html | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/document/writeln/index.html b/files/zh-cn/web/api/document/writeln/index.html new file mode 100644 index 0000000000..aa133ef635 --- /dev/null +++ b/files/zh-cn/web/api/document/writeln/index.html @@ -0,0 +1,25 @@ +--- +title: document.writeln +slug: Web/API/Document/writeln +translation_of: Web/API/Document/writeln +--- +<p>{{ ApiRef() }}</p> +<h3 id="Summary" name="Summary">概述</h3> +<p>向文档中写入一串文本,并紧跟着一个换行符。</p> +<h3 id="Syntax" name="Syntax">语法</h3> +<pre class="eval">document.writeln(<em>line</em>); +</pre> +<h3 id="Parameters" name="Parameters">参数</h3> +<ul> + <li><code>line</code> 为包含文本的字符串</li> +</ul> +<h3 id="Example" name="Example">示例</h3> +<pre>document.writeln("<p>enter password:</p>"); +</pre> +<h3 id="Notes" name="Notes">备注</h3> +<p><strong>document.writeln</strong> 和 <a href="/en/DOM/document.write" title="en/DOM/document.write">document.write</a> 一样,但是会添加一个换行符。</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" title="http://www.w3.org/MarkUp/2004/xhtml-faq#docwrite">W3C XHTML FAQ</a>.</div> +<h3 id="Specification" name="Specification">规范</h3> +<p><a class="external" href="http://www.w3.org/TR/2000/WD-DOM-Level-2-HTML-20001113/html.html#ID-35318390">writeln </a></p> +<p>{{ languages( { "ja": "ja/DOM/document.writeln", "pl": "pl/DOM/document.writeln" } ) }}</p> |