8

I'm getting this error only in IE in my MVC site:

SCRIPT5007: Unable to get property 'call' of undefined or null reference jquery.validate.js, line 1234 character 5

I've looked around quite a bit for answers, and cannot find a solution. Chrome works fine. When I Google the exact error message, I was led here: script bundle not working, but answers there didn't help me.

I tried updating my jQuery and jQuery validation plugins via Visual Studio NuGet package manager. I upgraded jQuery to version 2.0.3 and jQuery Validation 1.11.1. I think I had jQuery 1.9.x before. This had no effect.

I believe my bundles are standard:

bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                    "~/Scripts/jquery-{version}.js"));

bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
                    "~/Scripts/jquery-ui-{version}.js"));

bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
                    "~/Scripts/jquery.unobtrusive*",
                    "~/Scripts/jquery.validate*"));

and at the tail end of my layout page, these are my Scripts.Render calls:

        @Scripts.Render("~/bundles/jquery")
        @Scripts.Render("~/bundles/jqueryui")
        @Scripts.Render("~/bundles/jqueryval")
        @RenderSection("Scripts", false)
    </body>    
</html>

any help is greatly appreciated.

Community
  • 1
  • 1
Adam O'Neil
  • 667
  • 1
  • 8
  • 18
  • 7
    I would add jquery migrate to make sure that it isn't bump up past jquery 1.8.2 that has caused it. i know jquery 1.9.x had some issues with the validation library – Slicksim Jul 26 '13 at 08:35
  • thank you that seemed to work -- would love to give you some credit for that if you enter as answer – Adam O'Neil Jul 26 '13 at 16:48

1 Answers1

5

I installed Bootstrap MVC4 via NuGet when the exact error happened to my app. The latest Bootstrap MVC4 install removes jquery-1.8.2* and installs jquery-1.9.1* as dependencies. jquery.validate was apparently not playing nice with jquery-1.9.1. https://github.com/jzaefferer/jquery-validation states they are not addressing any IE-Compatibility-Mode-related problems (understandably). Trouble is, I was running IE10 - Compatibility Mode off, and I was still getting the error. I added all the latest versions of all the jquery files in my project, removed the older ones from the project, and success in IE!

indyitman
  • 76
  • 1
  • 5
  • My project already had the jQuery Validation script included, but I used Nuget to "install" it which downloaded the current copy and replaced it with the old one. This is great because now if there's an update I will be alerted and can update automatically. Anyways, upgrading to the latest fixed my issue (I'm using jQuery 2.0.3) – The Muffin Man Jan 17 '14 at 18:56