如何在django管理员中更新jquery版本 [英] How can I update jquery version in django admin
问题描述
如何在Django管理员中更新jquery版本?
不将其替换为django / contrib / admin / media / js / admin / jquery.min.js
最新的jquery.min.js。
另外我不想在我的管理员中使用两个版本的jquery。
How can I update jquery version in Django admin? Without replacing it in django/contrib/admin/media/js/admin/ jquery.min.js To newest jquery.min.js. Also I don't want to use two versions of jquery in my admin.
推荐答案
这是你唯一的两个选项。你是正确的改变实际的Django文件是一个坏主意,所以唯一的另外一个选择是加载自己的除此之外。
That's your only two options. You're right about changing the actual Django file being a bad idea, so the only other option is to load your own in addition to that.
Django版本的jQuery已经命名为 django.jQuery
,所以你可以加载自己的版本的jQuery有或没有 jQuery.noConflict()
。
The Django version of jQuery is already namespaced as django.jQuery
, so you can load your own version of jQuery with or without jQuery.noConflict()
.
我明白你在同一页面上运行两个版本的jQuery的感觉,但这是管理员网站,而不是您的面向用户的网站。加载图书馆的速度并不是两倍,但它甚至只适用于使用管理员的用户(或可能只是自己)的句柄。
I understand you feelings toward running two versions of jQuery on the same page, but this is the admin site, not your user-facing website. It's not that much of a speed cost loading the library twice, but it will only even be applicable to the handle of users (or maybe just yourself) who use the admin.
这篇关于如何在django管理员中更新jquery版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!