jQuery.now() 函數會回傳當前時間的數值形式,回傳值的型別為 Number。此函數自 jQuery 1.4.3 版本起出現,且不接受任何參數。
<script type="text/javascript" src="https:///keleyi/pmedia/jquery/jquery-1.11.0.min.js"></script> <script> document.write($.now()) </script>
執行結果如下:
由於會隨時間變動,不同時間開啟本頁面結果不同,可以重新整理看看差異。
jQuery.now() Returns: Number
Description: Return a number representing the current time.
version added: 1.4.3 — This method does not accept any arguments. The $.now() method is a shorthand for the number returned by the expression (new Date).getTime().