JQuery Collection

== settimeout==
将函数延时触发:
console.log(1);
setTimeout(function(){
  console.log(2);
  }, 0);
console.log(3);

时间单位为毫秒。

setTimeout("alert('Boom!');", 2000);

取消触发:
var timer = setTimeout(myFunction, 3000);
clearTimeout(timer);

== 计算时差,秒为单位==
a = new Date()
b = new Date()
b.getTime() - a.getTime() 		#=>  timestamp


# Firefox和Safari会bfcache,即返回存在页面缓存~

back时不会触发load, ready事件, 只会触发onpageshow。



你可能感兴趣的:(JQuery Collection)