Django admin - jQuery namespace

后端 未结 3 517
故里飘歌
故里飘歌 2021-01-18 01:14

I\'m trying to use certain jQuery plugins in my Django admin site.

Django admin sets the jQuery namespace to django.jQuery (to avoid conflicts)

3条回答
  •  自闭症患者
    2021-01-18 02:01

    I suggest you to leave the jQuery in django.jQuery namespace wich is a good idea when using cms with different modules that could conflict. But you wrap your plugin within such :

    ;(function($){
      // here $ is only in this scope and so totally inobrusive
      // plugin code
    })(django.jQuery);
    

提交回复
热议问题