Error: TypeError: $(…).dialog is not a function

后端 未结 7 1661
半阙折子戏
半阙折子戏 2020-11-27 06:29

I am having an issue getting a dialog to work as basic functionality. Here is my jQuery source imports:



        
7条回答
  •  一生所求
    2020-11-27 06:51

    I had a similar problem and in my case, the issue was different (I am using Django templates).

    The order of JS was incorrect (I know that's the first thing you check but I was almost sure that that was not the case, but it was). The js calling the dialog was called before jqueryUI library was called.

    I am using Django, so was inheriting a template and using {{super.block}} to inherit code from the block as well to the template. I had to move {{super.block}} at the end of the block which solved the issue. The js calling the dialog was declared in the Media class in Django's admin.py. I spent more than an hour to figure it out. Hope this helps someone.

提交回复
热议问题