input输入框实时监控 并实现延迟发起请求
实时监控input代码
autoWatch:function(){
var that=this;
var $ele=$(this.element);
$ele.on('input propertychange',function(){
//console.log($(this));
var oldValue=$(this).data('oldValue');
var newValue=$(this).val();
if(oldValue==newValue){
//console.log('oldValue==newValue');
that.show();
return false;
}else{
//that.requestData(newValue);
that.delayRequest(newValue,0);
}
})
}autoW