jQuery Validation插件,IE7“SCRIPT3:未找到成员” [英] jQuery Validation plugin, IE7 "SCRIPT3: Member not found"
本文介绍了jQuery Validation插件,IE7“SCRIPT3:未找到成员”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下内容:
<html>
<head>
</head>
<body>
<div>
<form method="post">
<div id="questions">
<label for="question-6">Name of Course:</label>
<input type="text" name="name_of_course[response]" value="" id="question-6" class="required">
<label class="control-label" for="reporting-year">Reporting Year: </label>
<select name="reporting_year" id="reporting-year">
<option value="-1" selected="selected">Select option...</option>
<option value="4">2013-2014</option>
<option value="1">2012-2013</option>
<option value="2">2011-2012</option>
<option value="3">2010-2011</option>
</select>
</div>
<input type="submit" name="submit" value="Save Entry" class="btn">
</form>
</div>
<script src="//code.jquery.com/jquery.js"></script>
<script src="//ajax.aspnetcdn.com/ajax/jquery.validate/1.10.0/jquery.validate.min.js"></script>
<script>
$(function(){
jQuery.validator.addMethod("notEqual", function(value, element, param) {
return this.optional(element) || value !== param;
}, "Please select an option");
$('form').validate({
rules:{
'reporting_year': {
notEqual: "-1"
}
}
});
});
</script>
</body>
</html>
每个人最喜欢的浏览器,IE7(真的是兼容IE10)在控制台中报告以下错误:
Everyone's favorite browser, IE7 (IE10 w/compatibility really) is reporting the following error in the console:
SCRIPT3:找不到会员。
SCRIPT3: Member not found.
jquery.js,第2525行4
jquery.js, line 2525 character 4
当然IE8及以上版本工作正常,但我的客户端正在使用IE7。
Of course IE8 and above work fine, but my client is using IE7.
推荐答案
看起来这是IE10在兼容模式下的一个错误,因为据报道它可以在IE7中运行。但是这里有一些jquery解决方法:
http://bugs.jquery.com/ticket/ 12577
Looks like it's a bug with IE10 in compatibility mode as it is reported to work in IE7. But there are some jquery workarounds posted here: http://bugs.jquery.com/ticket/12577
这篇关于jQuery Validation插件,IE7“SCRIPT3:未找到成员”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文