+ -
当前位置:首页 → 问答吧 → 怎么不引起2次onchange事件

怎么不引起2次onchange事件

时间:2011-12-01

来源:互联网

下了个插件 发现引发了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);
}
});

作者: ayun00   发布时间: 2011-12-01

onchange改成onpropertychange

作者: qq307023807   发布时间: 2011-12-01

相关阅读 更多