标签:
self.searchOldTime = 0;
self.searchDelayTime = 400;
var searchNewTime = new Date().getTime();
if(searchNewTime-self.searchOldTime < self.searchDelayTime){
clearTimeout(t);
}else{
self.searchOldTime = searchNewTime;
t = setTimeout(function(){ //延迟0.4S请求
var _title = $(e.target).closest(‘input‘).val();
self.getPasrentsTaskFromServer(_title);
},self.searchDelayTime);
}
标签:
原文地址:http://www.cnblogs.com/peng14/p/4203048.html