加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – JavaScript运行时错误:无法获取未定义或空引用的属性“ms

发布时间:2020-12-15 18:18:08 所属栏目:百科 来源:网络整理
导读:我只是尝试将我的 jquery ui引用更改为母版页.我只在Internet Explorer上得到上面的错误. 我没有在Firefox和Chrome上得到错误. 这是抛出错误的jquery代码: return a.browser.msie?(b=Math.max(document.documentElement.scrollWidth,document.body.scrollWi
我只是尝试将我的 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代码似乎给出了一个错误,指出’dialog’对象未定义或’tooltip’对象未定义.我认为当我尝试将引用放在head部分时,jquery库没有被加载.

解决方法

jQuery.browser在jQuery 1.9中已经是 removed(并且你使用1.10),因此任何将其作为对象处理的尝试(即访问其msie属性)注定会失败.如果您仍想使用它,请包含 jQuery migrate插件和jQuery

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读