aboutsummaryrefslogtreecommitdiff
path: root/files/zh-tw/web/api/event/timestamp
diff options
context:
space:
mode:
Diffstat (limited to 'files/zh-tw/web/api/event/timestamp')
-rw-r--r--files/zh-tw/web/api/event/timestamp/index.html54
1 files changed, 54 insertions, 0 deletions
diff --git a/files/zh-tw/web/api/event/timestamp/index.html b/files/zh-tw/web/api/event/timestamp/index.html
new file mode 100644
index 0000000000..3ec006a09e
--- /dev/null
+++ b/files/zh-tw/web/api/event/timestamp/index.html
@@ -0,0 +1,54 @@
+---
+title: Event.timeStamp
+slug: Web/API/Event/timeStamp
+translation_of: Web/API/Event/timeStamp
+---
+<div>{{ApiRef("DOM")}}</div>
+
+<h2 id="Summary" name="Summary">說明</h2>
+
+<p>回傳事件建立的時間(單位是毫秒;從 epoch 開始計算)。</p>
+
+<h2 id="Syntax" name="Syntax">Syntax</h2>
+
+<pre class="syntaxbox">event.timeStamp
+</pre>
+
+<h2 id="Examples" name="Examples">範例</h2>
+
+<pre><em>var number</em> = event.timeStamp;
+</pre>
+
+<p>下面是一個較為完整的範例:</p>
+
+<pre class="brush: html">&lt;html&gt;
+&lt;head&gt;
+
+&lt;title&gt;timeStamp example&lt;/title&gt;
+
+&lt;script type="text/javascript"&gt;
+function getTime(event) {
+ document.getElementById("time").firstChild.nodeValue = event.timeStamp;
+}
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onkeypress="getTime(event)"&gt;
+
+&lt;p&gt;Press any key to get the current timestamp
+for the onkeypress event.&lt;/p&gt;
+&lt;p&gt;timeStamp: &lt;span id="time"&gt;-&lt;/span&gt;&lt;/p&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
+</pre>
+
+<h2 id="Notes" name="Notes">注意</h2>
+
+<p>這個 property 僅在瀏覽器支持該事件才會有用。</p>
+
+<h2 id="Specification" name="Specification">詳細資料</h2>
+
+<ul>
+ <li><a class="external" href="http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/events.html#Events-Event-timeStamp">timestamp </a></li>
+</ul>