简体   繁体   English

为什么jQuery给我一个错误'没有方法可排序'?

[英]Why does jQuery give me an error 'has no method sortable'?

I have a fiddle here 我这里有个小提琴

http://jsfiddle.net/WULsZ/1/ http://jsfiddle.net/WULsZ/1/

I load jQuery first and the code is pretty much straight from the sample so I'm puzzled as to why I'm getting an error 我首先加载jQuery,代码几乎直接来自示例所以我很困惑为什么我收到错误

Demo: http://jsfiddle.net/WULsZ/3/ 演示: http//jsfiddle.net/WULsZ/3/

You have to include jQuery Core, then jQuery UI. 你必须包括jQuery Core,然后是jQuery UI。

<script src="http://dl.dropbox.com/u/12337149/jquery.js"></script>
<script src="http://dl.dropbox.com/u/12337149/jquery-ui.js"></script>

If you include jQuery UI it will try to extend the jQuery Core, and if you include jQuery Core it will overwrite any previous instance of jQuery Core (including the extended jQuery UI code). 如果你包含jQuery UI,它将尝试扩展jQuery Core,如果你包含jQuery Core,它将覆盖任何以前的jQuery Core实例(包括扩展的jQuery UI代码)。

Documentation: http://learn.jquery.com/jquery-ui/getting-started/ 文档: http//learn.jquery.com/jquery-ui/getting-started/

Here you go working demo : http://jsfiddle.net/WULsZ/7/ 在这里你去工作演示http//jsfiddle.net/WULsZ/7/

Hope this helps, cheers 希望这会有所帮助,欢呼

Missing: 失踪:

  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>

Jquery Code Jquery代码

$(function () {
    $("#sortable").sortable();
    $("#sortable").disableSelection();
});​

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM