jQuery.ui.draggable.js和jQuery.ui.widget.js冲突 [英] jQuery.ui.draggable.js and jQuery.ui.widget.js conflict
问题描述
我有一个工作应用程序,它使用了一个jquery ui对话框。我想让对话框可拖动。据我所知,唯一需要的是jquery.ui.draggable.js脚本。所以我将它添加到我正在使用的脚本中,但是知道我收到以下错误(如firebug控制台中所示):base不是构造函数
jquery.ui.widget.js中的相关行是:
I had a working application, which uses a jquery ui dialog. I wanted to make the dialog draggable. As far as I know the only thing needed is the jquery.ui.draggable.js script. So I added it to the scripts I am using, but know I get the following error (as shown in the firebug console): base is not a constructor The relevante line in jquery.ui.widget.js is:
var basePrototype = new base();
这是我添加所有脚本的方式:
This is how I am adding all the scripts:
<script type="text/javascript" src="/media/development-bundle/jquery-1.4.2.js"></script>
<script type="text/javascript" src="/media/development-bundle/ui/jquery.ui.core.js"></script>
<script type="text/javascript" src="/media/development-bundle/ui/jquery.ui.widget.js"></script>
<script type="text/javascript" src="/media/development-bundle/ui/jquery.ui.draggable.js"></script>
<script type="text/javascript" src="/media/development-bundle/ui/jquery.ui.position.js"></script>
<script type="text/javascript" src="/media/development-bundle/ui/jquery.ui.autocomplete.js"></script>
<script type="text/javascript" src="/media/development-bundle/ui/jquery.ui.dialog.js"></script>
我做错了什么?或者这是jquery的问题?
Am I doing something wrong? or is this a problem with jquery?
提前感谢您的任何帮助
推荐答案
问题是draggable扩展了$ .ui,mouse,并且包含在UI 1.7x中的ui核心文件中。
The problem is that draggable extends $.ui,mouse, and that was included in the ui core file in UI 1.7x.
你需要包括在draggable之前的jquery.ui.mouse.js,这将解决问题。
You will need to include jquery.ui.mouse.js before draggable, and that will fix the problem.
这篇关于jQuery.ui.draggable.js和jQuery.ui.widget.js冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!