无法获取属性'应用'未定义或空引用的IE11和Chrome

Unable to get property 'apply' of undefined or null reference - IE11 and Chrome

本文关键字:引用 Chrome IE11 应用 获取 属性 未定义      更新时间:2023-09-26

我是JavascriptjQuery的新手,在修复此错误时遇到了问题。

当我尝试在IE11和chrome中调试时,会出现此错误。最初我得到了

无法获取未定义或空引用的属性"call"

jquery.validate.min.js中为event.handle.call和我做了一些研究,并通过更改为event.dispatch.call来修复它。一旦我修复了这个错误,我就找不到任何好的解决方案。

我正在使用jQuery 1.10.*,并希望在调试IE11Chrome时修复此错误。

任何建议都会非常有用。给我指出任何有用的资源或可能的解决方案。

编辑:

我在jQuery-ui-1.10.3.js 中的函数handlerProxy中收到此错误

$.each( handlers, function( event, handler ) {
    function handlerProxy() {
        // allow widgets to customize the disabled handling
        // - disabled as an array instead of boolean
        // - disabled class as method for disabling individual parts
        if ( !suppressDisabledCheck &&
                ( instance.options.disabled === true ||
                    $( this ).hasClass( "ui-state-disabled" ) ) ) {
            return;
        }
        return ( typeof handler === "string" ? instance[ handler ] : handler )
            .apply( instance, arguments );
    }
}

很可能您使用的是过时版本的jquery.validate。获取您版本的jquery的最新版本,它应该可以工作。这就是我解决这个问题的方法。我使用的是jquery1.11和jquery.validate1.10,并将validate更新为1.11,效果很好。