# Integrating JQuery-UI

**URL:** <https://forum.djangoproject.com/t/integrating-jquery-ui/42695>\
**Category:** Templates & Frontend\
**Created:** [August 26, 2025, 3:41pm UTC](https://forum.djangoproject.com/t/integrating-jquery-ui/42695 "2025-08-26T15:41:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![BobHillDev](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/bobhilldev/32/25117_2.png) [@BobHillDev](https://forum.djangoproject.com/u/BobHillDev)\
**Post date:** [August 26, 2025, 3:41pm UTC](https://forum.djangoproject.com/t/integrating-jquery-ui/42695/1 "2025-08-26T15:41:54Z")

</div>

I am trying to integrate JQuery-UI into my Django app, specifically to implement the draggable() functionality. However, I’m getting this error in the console.

Uncaught TypeError: $(…).draggable is not a function

Here is the section of code where the library is included.

```auto
    <!-- JQuery Stuff-->
    <script type="text/javascript" src="{% static 'js/jquery-3.7.1.min.js' %}"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.mask/1.14.16/jquery.mask.min.js"></script>
    <!-- JQuery UI library -->
    <script type="javascript" src="{% static 'js/jquery-ui.js' %}"></script>

```

This is in my **main.html** file which is included via the extends clause in the template.

I know that JQuery is functioning because I am using it in the code for selecting elements, detecting screen positions, etc. These JQuery functions all work fine.

Here is the block of code that implements the draggable function:

```auto
            $(function(){
                $("#drag").draggable({containment: [0, 60, 1300, 600], cursor: 'pointer', opacity: 0.60,});
            });

```

I have a small working prototype outside of Django where this is working. I just can’t get it to recognize the jquery-us.js library in the Django app.

Any ideas on what might be wrong?

---

<div class="post-metadata">

**Author:** ![philgyford](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/philgyford/32/14295_2.png) [@philgyford](https://forum.djangoproject.com/u/philgyford)\
**Post date:** [August 26, 2025, 8:52pm UTC](https://forum.djangoproject.com/t/integrating-jquery-ui/42695/2 "2025-08-26T20:52:29Z")

</div>

If you view the Network tab in your browser’s web developer tools, is `jquery-ui.js` actually loading successfully?

Alternatively, is the request for it in the logs of `manage.py runserver` showing a 200 response?

---

<div class="post-metadata">

**Author:** ![PyPHAnetwork](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/pyphanetwork/32/28160_2.png) [@PyPHAnetwork](https://forum.djangoproject.com/u/PyPHAnetwork)\
**Post date:** [August 27, 2025, 2:05pm UTC](https://forum.djangoproject.com/t/integrating-jquery-ui/42695/3 "2025-08-27T14:05:06Z")

</div>

Okay, according to the Network tab, it is NOT being loaded.

 ![Draggable_01](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/3X/c/9/c95b7cf90374e6348c1b8450be0d88a50ca50b56.png)

However, here is the code in the section of Main.html which is extended into the template.

```auto
    <!-- JQuery Stuff-->
    <script type="text/javascript" src="{% static 'js/jquery-3.7.1.min.js' %}"></script>
    <!-- JQuery UI library -->
    <script type="javascript" src="{% static 'js/jquery-ui.js' %}"></script>

```

I have triple-checked the static/js folder and this JavaScript file is there. I have also confirmed the STATIC\_URL value in settings.py.

```auto
STATIC_URL = 'static/'
MEDIA_URL = '/images/'

STATICFILES_DIRS = [
    BASE_DIR / 'static',
]

```

Any ideas on what might be keeping this from being loaded?

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [August 27, 2025, 2:10pm UTC](https://forum.djangoproject.com/t/integrating-jquery-ui/42695/4 "2025-08-27T14:10:17Z")

</div>

Please show your complete `main` template and the output from your server log showing the request for this page and the requests for the associated css / js files. (We may also need to see the template extending your main template, but won’t know for sure until we see that base template.)

---

<div class="post-metadata">

**Author:** ![PyPHAnetwork](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/pyphanetwork/32/28160_2.png) [@PyPHAnetwork](https://forum.djangoproject.com/u/PyPHAnetwork)\
**Post date:** [August 27, 2025, 2:16pm UTC](https://forum.djangoproject.com/t/integrating-jquery-ui/42695/5 "2025-08-27T14:16:13Z")

</div>

Okay, I have an update on this.

Changing the script declaration in main.html to

```auto
<script type="text/javascript" src="{% static 'js/jquery-ui.js' %}"></script>

```

Solved the issue. jquery-ui.js module is now appearing as loaded, and the draggable elements are working.

I was missing the “text/” part.

Thanks for all of the replies!
