简体   繁体   English

JavaScript运行时错误:无法获取未定义或空引用的属性“msie”

[英]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 . 我只是尝试将我的jquery ui引用更改为母版页。 I get the error above only on Internet explorer. 我只在Internet Explorer上得到上面的错误。 I dont get the error on Firefox and Chrome . 我没有在Firefox和Chrome上得到错误。

This is the jquery code where the error is thrown : 这是抛出错误的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()

I have the master page below : 我有以下母版页:

<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>

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. 我尝试将jquery引用放在head部分中,但是我的aspx文件中的jquery代码似乎给出了一个错误,指出'dialog'对象未定义或'tooltip'对象未定义。 I think the jquery library is not getting loaded when I try to put the references in the head section. 我认为当我尝试将引用放在head部分时,jquery库没有被加载。

jQuery.browser has been removed in jQuery 1.9 (and you use 1.10), so any attempt to process it as an object (ie, access its msie property) is destined to fail. jQuery.browser已经在jQuery 1.9中删除了(你使用的是1.10),所以任何将它作为对象处理的尝试(即访问它的msie属性)都注定要失败。 If you still want to use it, include jQuery migrate plugin along with jQuery 如果您仍想使用它,请包含jQuery migrate plugin和jQuery

我将jquery-ui更新为1.11.3,问题就消失了。

Add library from given link in your project. 从项目中的给定链接添加库。

http://code.jquery.com/jquery-migrate-1.2.1.js http://code.jquery.com/jquery-migrate-1.2.1.js

or 要么

Register below link in your page 在您的页面中注册以下链接

<script type="text/javascript" src="code.jquery.com/jquery-migrate-1.2.1.js"></script>

The jquery-browser-plugin now provides the $.browser object. jquery-browser-plugin现在提供$ .browser对象。 Including $.browser.msie 包括$ .browser.msie

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误“ JavaScript运行时错误:无法获取未定义或空引用的属性&#39;scrollLeft&#39;”,同时找到滚动位置 - error“JavaScript runtime error: Unable to get property 'scrollLeft' of undefined or null reference” while finding scroll position 0x800a138f-JavaScript运行时错误:无法获取未定义或空引用的属性“ split” - 0x800a138f - JavaScript runtime error: Unable to get property 'split' of undefined or null reference 0x800a138f - JavaScript运行时错误:无法获取未定义或空引用的属性“mData” - 0x800a138f - JavaScript runtime error: Unable to get property 'mData' of undefined or null reference Javascript运行时错误:无法获取动态创建的文本框的未定义或空引用的属性“样式” - Javascript Runtime Error: Unable to get property 'style' of undefined or null reference of dynamically created Textboxes Javascript错误:无法获取未定义或空引用的“点击”属性 - Javascript error: Unable to get property of 'click' of undefined or null reference JavaScript运行时错误:无法获取显示Microsoft Report Viewer ASPX控件的未定义或空引用的属性&#39;add_init&#39; - JavaScript runtime error: Unable to get property 'add_init' of undefined or null reference displaying Microsoft Report Viewer ASPX control 错误:无法获取未定义或空引用的属性“ _ScriptLoaderTask” - Error: Unable to get property '_ScriptLoaderTask' of undefined or null reference 无法获取未定义或空引用的属性“隐藏” - Unable to get property 'hide' of undefined or null reference 无法获取未定义或空引用的属性值 - unable to get property value of undefined or null reference 无法获取属性“ length”的值:对象为null或未定义-Javascript错误 - Unable to get value of the property 'length': object is null or undefined - Javascript Error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM