jquery.validate.js中的错误"javaScript运行时错误:无法获取未定义或空引用的属性'调用'"

joh*_* Gu 6 javascript asp.net jquery jquery-validate razor

我正在开发一个asp.net mvc-5 Web应用程序.我正在使用这些脚本: -

  • jquery 1.10.2
  • jquery-ui 1.8.24
  • jQuery Validation Plugin 1.11.1

现在,当我在visual studio 2013中运行应用程序时,IE10会发生以下异常,而chrome或firefox上没有任何问题: -

Unhandled exception at line 1234, column 5 in http://localhost:49392/Scripts/jquery.validate.js

0x800a138f - JavaScript runtime error: Unable to get property 'call' of undefined or null reference
Run Code Online (Sandbox Code Playgroud)

将引发jquery.validate.js内部错误的代码是: -

function($) {
    // only implement if not provided by jQuery core (since 1.4)
    // TODO verify if jQuery 1.4's implementation is compatible with older jQuery special-event APIs
    if (!jQuery.event.special.focusin && !jQuery.event.special.focusout && document.addEventListener) {
        $.each({
            focus: 'focusin',
            blur: 'focusout'
        }, function( original, fix ){
            $.event.special[fix] = {
                setup:function() {
                    this.addEventListener( original, handler, true );
                },
                teardown:function() {
                    this.removeEventListener( original, handler, true );
                },
                handler: function(e) {
                    var args = arguments;
                    args[0] = $.event.fix(e);
                    args[0].type = fix;
                    return $.event.handle.apply(this, args);
                }
            };
            function handler(e) {
                e = $.event.fix(e);
                e.type = fix;
                **return $.event.handle.call(this, e);**//this will raise the exception
            }
        });
    }
Run Code Online (Sandbox Code Playgroud)

任何人都可以尝试我如何解决这个问题?谢谢

Pan*_*ool 7

安装jquery migrate可以解决这个问题 PM> Install-Package jQuery.Migrate