aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/performance/tojson
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/performance/tojson
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/zh-cn/web/api/performance/tojson')
-rw-r--r--files/zh-cn/web/api/performance/tojson/index.html61
1 files changed, 61 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/performance/tojson/index.html b/files/zh-cn/web/api/performance/tojson/index.html
new file mode 100644
index 0000000000..df229b33cb
--- /dev/null
+++ b/files/zh-cn/web/api/performance/tojson/index.html
@@ -0,0 +1,61 @@
+---
+title: Performance.toJSON()
+slug: Web/API/Performance/toJSON
+translation_of: Web/API/Performance/toJSON
+---
+<div>{{APIRef("High Resolution Timing")}}</div>
+
+<div>{{domxref("Performance")}} 的 <strong><code>toJSON() 方法是一个标准的串行器:它返回一个由 performance 对象各个属性组成的 JSON</code></strong></div>
+
+<h2 id="Syntax">Syntax</h2>
+
+<pre class="syntaxbox">myPerf = performance.toJSON()
+</pre>
+
+<h3 id="Arguments">Arguments</h3>
+
+<dl>
+ <dt>None</dt>
+ <dd> </dd>
+</dl>
+
+<h3 id="Return_value">Return value</h3>
+
+<dl>
+ <dt>myPerf</dt>
+ <dd>{{domxref("Performance")}} 对象序列化之后转化成的 JSON 对象。</dd>
+</dl>
+
+<h2 id="Example">Example</h2>
+
+<pre class="brush: js">var js;
+js = window.performance.toJSON();
+console.log("json = " + JSON.stringify(js));
+</pre>
+
+<h2 id="Specifications">Specifications</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('Highres Time Level 2', '#the-performance-interface', 'toJSON() serializer')}}</td>
+ <td>{{Spec2('Highres Time Level 2')}}</td>
+ <td>Defines <code>toJson()</code>.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility">Browser compatibility</h2>
+
+<div>
+<div>
+
+
+<p>{{Compat("api.Performance.toJSON")}}</p>
+</div>
+</div>