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/domexception/code | |
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/domexception/code')
-rw-r--r-- | files/zh-cn/web/api/domexception/code/index.html | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/domexception/code/index.html b/files/zh-cn/web/api/domexception/code/index.html new file mode 100644 index 0000000000..5c0d12d873 --- /dev/null +++ b/files/zh-cn/web/api/domexception/code/index.html @@ -0,0 +1,43 @@ +--- +title: DOMException.code +slug: Web/API/DOMException/code +translation_of: Web/API/DOMException/code +--- +<p>{{ APIRef("DOM") }}</p> + +<p>{{domxref("DOMException")}} 接口中的 <strong><code>code</code></strong> 是一个只读属性,他返回了一个包含了 <a href="/zh-CN/docs/Web/API/DOMException#Error_names">错误常量</a> 的<code>简短</code><font face="consolas, Liberation Mono, courier, monospace"><span style="background-color: rgba(220, 220, 220, 0.5);">数字</span></font> ,或者在没有匹配到时返回 <code>0</code> 。这个字段产生于历史原因,在新的DOM异常中已停止使用,改为在 {{domxref("DOMException.name")}} 属性中推送此信息。</p> + +<h2 id="语法">语法</h2> + +<pre class="syntaxbox">var domExceptionCode = domExceptionInstance.code; +</pre> + +<dl> +</dl> + +<h3 id="值">值</h3> + +<p>一个数字</p> + +<h2 id="规范">规范</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">规范</th> + <th scope="col">状态</th> + <th scope="col">评论</th> + </tr> + <tr> + <td>{{SpecName('WebIDL', '#dom-domexception-code', 'code')}}</td> + <td>{{Spec2('WebIDL')}}</td> + <td> </td> + </tr> + </tbody> +</table> + +<h2 id="浏览器兼容性">浏览器兼容性</h2> + +<div class="hidden">此页面上的兼容性表由结构化数据生成。如果您想参入构建这些数据,请查看<a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> 并给我们发送一个pull request</div> + +<p>{{Compat("api.DOMException.code")}}</p> |