Home >Web Front-end >JS Tutorial >Detailed explanation of jQuery.now() function usage
jQuery.now() function is used to return the number of milliseconds that have elapsed since midnight on January 1, 1970.
The function of this function is similar to new Date().getTime();
This function belongs to the global jQuery object.
Syntax
jQuery 1.4.3 New The static function.
jQuery.now( )
Return value
jQuery.now()The return value of the function is Number type and returns the current time The number of milliseconds since midnight on January 1, 1970.
Example & Description
The source code part of the jQuery.now() function is as follows:
now: function() { return +( new Date() ); }
The following jQuery sample code is used to demonstrate the specific usage of the jQuery.now() function :
//在当前页面内追加换行标签和指定的HTML内容 function w( html ){ document.body.innerHTML += "<br/>" + html; } w( $.now() ); // 返回当前时间的Unix时间戳
The above is the detailed content of Detailed explanation of jQuery.now() function usage. For more information, please follow other related articles on the PHP Chinese website!