CodeNinja CodeNinja - 1 year ago 215
ASP.NET (C#) Question

JavaScript runtime error: Unable to get property 'msie' of undefined or null reference

I just tried changing my jquery ui references to the master page . I get the error above only on Internet explorer.
I dont get the error on Firefox and Chrome .

This is the jquery code where the error is thrown :

return a.browser.msie?(b=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),c=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth),b<c?a(window).width()+"px":b+"px"):a(document).width()+"px"},resize:function(){var b=a([]);a.each(a.ui.dialog.overlay.instances,function()

I have the master page below :

<head id="Head1" runat="server">
<link rel="stylesheet" href=""
type="text/css" />
<asp:ContentPlaceHolder ID="ExtraHeadContent" runat="server">

<form id="form2" runat="server">
<asp:ScriptManager ID="ScriptManagerService" runat="server">
<asp:ScriptReference Path="" ScriptMode="Auto" />
<asp:ScriptReference Path="" ScriptMode="Auto" />

Please let me know what I need to be doing ?
I tried putting the jquery references in the head section , but the jquery code within my aspx file seems to give an error saying 'dialog' object not defined or 'tooltip' object not defined. I think the jquery library is not getting loaded when I try to put the references in the head section.

Answer Source

jQuery.browser has been removed in jQuery 1.9 (and you use 1.10), so any attempt to process it as an object (i.e., access its msie property) is destined to fail. If you still want to use it, include jQuery migrate plugin along with jQuery

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download