我刚刚尝试更改我对母版页的 jquery ui 引用。我只在 Internet Explorer 上收到上述错误。 我在 Firefox 和 Chrome 上没有收到错误。
这是抛出错误的 jquery 代码:
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()
我有下面的母版页:
<head id="Head1" runat="server">
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/redmond/jquery-ui.css"
type="text/css" />
<asp:ContentPlaceHolder ID="ExtraHeadContent" runat="server">
</asp:ContentPlaceHolder>
</head>
<form id="form2" runat="server">
<asp:ScriptManager ID="ScriptManagerService" runat="server">
<Scripts>
<asp:ScriptReference Path="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" ScriptMode="Auto" />
<asp:ScriptReference Path="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js" ScriptMode="Auto" />
</Scripts>
</asp:ScriptManager>
</form>
</body>
请让我知道我需要做什么? 我尝试将 jquery 引用放在 head 部分,但我的 aspx 文件中的 jquery 代码似乎给出了一个错误,指出“对话框”对象未定义或“工具提示”对象未定义。我认为当我尝试将引用放在 head 部分时,jquery 库没有加载。
最佳答案
jQuery.browser一直removed在 jQuery 1.9 中(您使用的是 1.10),因此任何将其作为对象处理的尝试(即访问其 msie
属性)注定会失败。如果您仍想使用它,请包含 jQuery migrate与 jQuery 一起使用的插件
关于c# - JavaScript 运行时错误 : Unable to get property 'msie' of undefined or null reference,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19100085/