"景先生毕设|www.jxszl.com

jquery的.dialog报不支持的对象或方法解决办法

2021-03-25 11:11编辑: www.jxszl.com景先生毕设
   原因:jquery的.dialog报不支持的对象或方法,问题原因是dialog插件js引用顺序问题。
代码:
 <link href="~/Easyui/themes/icon.css" rel="stylesheet" />
    <link href="~/Easyui/themes/default/easyui.css" rel="stylesheet" />
   <script src="~/Easyui/jquery.easyui.min.js"></script>
    <script src="~/Easyui/jquery.min.js"></script>

    <script type="text/javascript">
        $(document).ready(function () {
            $("#login").dialog({
                title: "登录",
                width: 300,
                height: 200
            });
        });
    </script>
提示1:0x800a1391 - JavaScript 运行时错误: “jQuery”未定义
提示2:0x800a01b6 - JavaScript 运行时错误: 对象不支持“dialog”属性或方法

解决办法: 标红的位置互换位置
    <link href="~/Easyui/themes/icon.css" rel="stylesheet" />
    <link href="~/Easyui/themes/default/easyui.css" rel="stylesheet" />
    <script src="~/Easyui/jquery.min.js"></script>
    <script src="~/Easyui/jquery.easyui.min.js"></script>

    <script type="text/javascript">
        $(document).ready(function () {
            $("#login").dialog({
                title: "登录",
                width: 300,
                height: 200
            });
        });
    </script>
原文链接:http://www.jxszl.com/jlmb/Others/55403.html