Uncaught TypeError: $(...).datagrid is not a function


项目中碰见异常“Uncaught TypeError: $(...).datagrid is not a function”,网上查询基本上都是jQuery的重复引用,但是找了半天依旧没找到问题所在,最后发现把“jquery-1.7.1.min.js”文件放到最上面就没有异常,可以正常使用了。

报异常时引用的文件代码:

<head>
    <title>@ViewBag.Title</title>
    <link href="~/Content/jquery-easyui-1.6.8/themes/icon.css" rel="stylesheet" />
    <link href="~/Content/jquery-easyui-1.6.8/themes/default/easyui.css" rel="stylesheet" />
    <script src="~/Content/jquery-easyui-1.6.8/jquery.easyui.min.js"></script>
    <script src="~/Content/jquery-easyui-1.6.8/locale/easyui-lang-zh_CN.js"></script>

    <script src="~/Scripts/jquery-1.7.1.min.js"></script>
    <script src="~/Scripts/datapattern.js"></script>
    <script src="~/Scripts/jquery.validate.min.js"></script>
    <script src="~/Scripts/jquery.unobtrusive-ajax.min.js"></script>
</head> 

异常:

 

修改后可用的引用的文件顺序(红框中的jquery文件放到easyui相关js上面就可以了,不明白原因,在此记录):


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM