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/console/debug/index.html | |
| 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/console/debug/index.html')
| -rw-r--r-- | files/zh-cn/web/api/console/debug/index.html | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/console/debug/index.html b/files/zh-cn/web/api/console/debug/index.html new file mode 100644 index 0000000000..5e99b5ac81 --- /dev/null +++ b/files/zh-cn/web/api/console/debug/index.html @@ -0,0 +1,67 @@ +--- +title: Console.debug() +slug: Web/API/Console/debug +tags: + - 控制台 + - 调试 +translation_of: Web/API/Console/debug +--- +<div>{{APIRef("Console API")}}</div> + +<p><span class="seoSummary"><code>{{domxref("Console")}}</code>.<strong><code>debug()</code></strong> 输出“调试”级别的消息且仅仅控制台配置为显示调试输出时才显示该消息。</span></p> + +<p>{{AvailableInWorkers}}</p> + +<h2 id="语法">语法</h2> + +<pre class="syntaxbox">console.debug(<em>对象1</em> [, <em>对象2</em>, ..., <em>对象N</em>]); +console.debug(<em>消息</em>[, 字符串<em>1</em>, ..., 字符串<em>N</em>]); +</pre> + +<h3 id="参数">参数</h3> + +<dl> + <dt><code>对象1</code> ... <code>对象N</code></dt> + <dd>要输出的JavaScript 对象列表。 按传参的顺序把对象输出到控制台。</dd> + <dt><code>消息</code></dt> + <dd>一个JavaScript字符串,其中包含零个或多个替代字符串。</dd> + <dt><code>字符串1</code> ... <code>字符串N</code></dt> + <dd>JavaScript 对象,用来依次替换<code>msg</code>中的替代字符串。你可以在替代字符串中指定对象的输出格式。查看{{SectionOnPage("/zh-CN/docs/Web/API/Console", "使用字符串替换")}}了解替换字符串如何工作。</dd> +</dl> + +<p>有关详细信息,请参阅{{domxref("console")}} 对象文档中的<a href="/zh-CN/docs/Web/API/console#Outputting_text_to_the_console">将文本输出到控制台</a>。</p> + +<h2 id="规范">规范</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName("Console API", "#debug", "console.debug()")}}</td> + <td>{{Spec2("Console API")}}</td> + <td>Initial definition</td> + </tr> + </tbody> +</table> + +<h2 id="浏览器兼容性">浏览器兼容性</h2> + +<div> +<div class="hidden">此页面上的兼容性表是根据结构化数据生成的。 如果您想为数据做出贡献,请查看https://github.com/mdn/browser-compat-data并向我们推送请求。</div> + +<p>{{Compat("api.Console.debug")}}</p> +</div> + +<h2 id="相关链接">相关链接</h2> + +<ul> + <li><a href="http://www.opera.com/dragonfly/documentation/console/">Opera Dragonfly documentation: Console</a></li> + <li><a href="http://msdn.microsoft.com/library/gg589530">MSDN: Using the F12 Tools Console to View Errors and Status</a></li> + <li><a href="https://developers.google.com/chrome-developer-tools/docs/console#errors_and_warnings">Chrome Developer Tools: Using the Console</a></li> +</ul> |
