Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error inside jquery.validate.js "javaScript runtime error: Unable to get property 'call' of undefined or null reference"

I am working on an asp.net mvc-5 web application. and i am using these scripts:-

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

Now when i run the application inside visual studio 2013, the following exception will happen on IE10 , while there will not be any problem on chrome or 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

the code which will raise the error inside the jquery.validate.js is :-

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
            }
        });
    }

Can anyone adivce how i can solve this problem ? Thank

like image 820
john Gu Avatar asked Jan 15 '15 14:01

john Gu


1 Answers

installing jquery migrate may solve this PM> Install-Package jQuery.Migrate

like image 132
Pandiyan Cool Avatar answered Oct 22 '22 00:10

Pandiyan Cool