这个问题 折腾我一天了。 网上也找不到答案,基本都是问题已经解决就无下文了,也没有分享问题解决方法 。
后来查到juqery.validate.js中发现elements方法中$([]).add(this.currentForm.elements)方法在ie8下有问题,只能得到一个jquery对象。(ie9和火狐浏览器正常) 后来根据源码中的注释提示在网站 http://bugs.jquery.com/ticket/2114 得到答案 : 原文:
jQuery的validate 在ie9和火狐下能用 在ie8下无效解决方法。
转载下一篇:我的友情链接
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
bootstrap支持ie8 让IE6 IE7 IE8 IE9 IE10 IE11支持Bootstrap的解决方法
做一个在线系统,PC端也要做,但要兼容千恶的IE8【IE6 是万恶,打让IE6 IE7 IE8 IE9 IE10 IE11支持Boots
javascript bootstrap ie 8 css CSS3 -
eWebEditor在IE8,IE7下所有按钮无效之解决办法
eWebEditor在IE8,IE7下所有按钮无效之解决办法
解决 办法 eWebEditor 休闲 按钮 -
完美支持IE8/IE9的鼠标手势
完美支持IE8/IE9的鼠标手势
鼠标手势 浏览器 插件 搜狗输入法 输入法
I had an issue where jquery.validate was failing in IE6, caused by the above error. I fixed this by updating line 446 and changed:
$([]).add(this.currentForm.elements).filter(":input")
to
$(':input',this.currentForm)
于是把juqery.validate.js中elements方法
return $([]).add(this.currentForm.elements)
.filter(":input")
.not(":submit, :reset, :p_w_picpath, [disabled]")
.not( this.settings.ignore )
.filter(function() {
!this.name && validator.settings.debug && window.console && console.error( "%o has no name assigned", this);
// select only the first element for each name, and only those with rules specified
if ( this.name in rulesCache || !validator.objectLength($(this).rules()) )
return false;
rulesCache[this.name] = true;
return true;
});
修改为:
return $(':input',this.currentForm)
问题暂时解决。不知道还是否留下其他问题或者引起其他错误。.not(":submit, :reset, :p_w_picpath, [disabled]")
.not( this.settings.ignore )
.filter(function() {
!this.name && validator.settings.debug && window.console && console.error( "%o has no name assigned", this);
// select only the first element for each name, and only those with rules specified
if ( this.name in rulesCache || !validator.objectLength($(this).rules()) )
return false;
rulesCache[this.name] = true;
return true;
});