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?
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.
I also had similar problem as this property was removed in jQuery 1.9... Add below code inside your page script tag.
jQuery.browser = {};
(function () {
jQuery.browser.msie = false;
jQuery.browser.version = 0;
if (navigator.userAgent.match(/MSIE ([0-9]+)\./)) {
jQuery.browser.msie = true;
jQuery.browser.version = RegExp.$1;
}
})();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With