Javascript timed getTime, javascriptgetTime
1. JS timing
Note that the date format cannot be, And IE11 does not support
Var d = new Date ("2014/11/14"); var c = new Date (); setInterval (function () {$ (". gift-input ").css (" background "," #99999
Today in a project to do a countdown to the effect of their own JS level is very general, on the Internet to find a section of the countdown code used (as follows):functionCountdown (jqueryobj) {varDay_elem = Jqueryobj.find ('. Day ')); varHour_elem
Original: http://www.cssrain.cn /? P = 305
(1) gettime (new date. gettime method)
Returns the number of milliseconds of the specified date object since midnight, January 1, January 1, 1970. This method is used to compare two or more date objects.
1, JS TimingNote Date format, cannot be used 2014-11-14,IE11 not supportedvar d=new date ("2014/11/14"), var c=new date (), SetInterval (function () {$ (". Gift-input input"). CSS ("Background", "# 999999 "); $ (". Gift-input input "). Val (" End of
JS optimization for IE6.0 function, summed up a few:
One, string concatenation: Using array stitching
Copy Code code as follows:
function Func2 () {
var start = new Date (). GetTime ();
var array = [];
for (var i = 0; i Array[i]
Js optimization works for IE6.0, which summarizes the following points:
I. String concatenation: concatenate strings with ArraysCopy codeThe Code is as follows:Function func2 (){Var start = new Date (). getTime ();Var array = [];For (var I = 0; I
The execution efficiency of JS code often directly affects the performance of the page, sometimes, to achieve the same function, different JS code often in the efficiency of a lot of differences, and sometimes just because of our writing habits
And then look at the function--the object with the magic color.
9, as a function of the value
In a general programming language, if you want to use a function as a value, you need to implement it like a function pointer or an agent, but in
No more nonsense, directly on the test code
Copy Code code as follows:
var aa = "{name: ' Cola ', item:[{age:11},{age:22},{age:23},{age:23}]}";
var now = new Date (). GetTime ();
for (var i = 0; i var a = eval ("+ AA +");
}
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.