怎么不引起2次onchange事件
下了个插件 发现引发了2次onchange事件
找到代码如下
没有看明白 field.change(toCheck).focus(toExp);这个是什么意思
怎么修改不引发2次onchange事件?
$.each(settings.items, function(){
var field = $("[name='"+this.name+"']",formObj[0]);
var obj = this,
toExp = function(){showExp(obj);},
toCheck = function(){ isAll=false; fieldCheck(obj);};
if(field.is(":file") || field.is("select")){
field.change(toCheck).focus(toExp);
}else{
field.blur(toCheck).focus(toExp);
}
});