diff options
Diffstat (limited to 'files/zh-tw/web/api/event/timestamp')
-rw-r--r-- | files/zh-tw/web/api/event/timestamp/index.html | 54 |
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"><html> +<head> + +<title>timeStamp example</title> + +<script type="text/javascript"> +function getTime(event) { + document.getElementById("time").firstChild.nodeValue = event.timeStamp; +} +</script> +</head> + +<body onkeypress="getTime(event)"> + +<p>Press any key to get the current timestamp +for the onkeypress event.</p> +<p>timeStamp: <span id="time">-</span></p> + +</body> +</html> +</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> |