Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
229 views
in Technique[技术] by (71.8m points)

javascript - jQuery.ui.draggable.js and jQuery.ui.widget.js conflict

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>

Am I doing something wrong? or is this a problem with jquery?

Thanks in advance for any help

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The problem is that draggable extends $.ui,mouse, and that was included in the ui core file in UI 1.7x.

You will need to include jquery.ui.mouse.js before draggable, and that will fix the problem.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...