6

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

6
  • 1
    your jquery version please? Jan 15, 2015 at 14:21
  • 1
    installing jquery migrate may solve this PM> Install-Package jQuery.Migrate Jan 15, 2015 at 14:24
  • @PandiyanCool jQuery version is 1.10.2
    – John John
    Jan 15, 2015 at 14:34
  • i run the Install-Package JQuery.Migrate and it added the following script inside the Scripts folder "jquery-migrate-1.2.1.js" and this solve the issue on IE10 .. thanks. but ca you advice what will the jquery-migrate-1.2.1.js did exactly ?
    – John John
    Jan 15, 2015 at 14:38
  • 1
    I think 1.2.1 version is fine Jan 15, 2015 at 14:47

1 Answer 1

7

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

6
  • yes it did ,, but what will this do exactly ? can you adivce ? will it force my web application to use jquery 1.2.1 ?
    – John John
    Jan 15, 2015 at 14:50
  • if this is the case, then why i can not delete the 1.10.2 and add the new version ?
    – John John
    Jan 15, 2015 at 14:51
  • 1
    it won't force the web app to use 1.2.1, its a fallback support methods and features dropped in current version. If you starting up your project in smaller manner newly, you can go up with the newer version :) Jan 15, 2015 at 14:56
  • So what will be the differences between using the migrate scripts and removing my previous jQuery 1.10.2 and add version 1.2.1 ??
    – John John
    Jan 15, 2015 at 15:10
  • 1
    See using migrate 1.2.1 does not means you are using jquery 1.2.1.. Using jquery 1.10 is fine to support IE9+ Jan 15, 2015 at 15:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.