user65439 user65439 - 5 months ago 13
Javascript Question

Unable to get property 'msie' of undefined or null reference

I'm trying to create a JQGrid in my MVC 4 view and getting a


Unable to get property 'msie' of undefined or null reference


error when adding the JQGrid javascript files

bundles.Add(new ScriptBundle("~/Bundles/Shared/JS").Include(
"~/Scripts/jquery-1.9.1.min.js",
"~/Scripts/jquery.validate.min.js",
"~/Scripts/bootstrap.js",
"~/Content/silviomoreto-bootstrap-select/bootstrap-select.min.js",
"~/Scripts/js/Shared/Index.js",
"~/Scripts/js/Shared/Validation.js",
"~/Scripts/jquery.placeholder.js",
"~/Content/jquery.jqGrid-4.4.3/js/i18n/grid.locale-en.js",
"~/Content/jquery.jqGrid-4.4.3/js/jquery.jqGrid.min.js"));


The error occurs on the following line

e=n.browser.msie&&"6.0"==n.browser.version


Any idea why this is happening?

Answer

From the jQuery docs for jQuery.browser:

This property was removed in jQuery 1.9 and is available only through the jQuery.migrate plugin. Please try to use feature detection instead.

So you'll have to drop down to an older version of jQuery or use the migrate plugin.