且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

jQuery .sortable不是一个函数

更新时间:2023-11-20 23:49:16

我弄清楚了。我需要排序的页面被加载到我的主页面中的div中。我不得不将jQuery UI脚本添加到该jsp而不是主页面jsp。有趣的是如何成功。


Even though I've followed the directions in the jQuery UI documentation, I'm getting the error that .sortable is not a function.
Here is my code:

<div style="float: left;">
    <span class="caption" style="width: 255px; display: block;">
        Assigned Limits
    </span>
    <div class="assigned-limit-box">
        <ul id="limAssigned" class="ul-base">
        </ul>
    </div>
</div>

This is my js:

$('#limAssigned').sortable();

My jQuery js is loaded before my jQuery UI js.

What am I doing wrong?

I figured it out. The page that I needed sortable for is loaded into a div within my main page. I had to add the jQuery UI script to that jsp rather than the main page jsp. Funny how that worked out.