mirror of https://github.com/django/django.git
[1.5.x] Fixed #19597 - Added some notes on jQuery in admin.
Thanks Daniele Procida.
Backport of d406afe12e
from master
This commit is contained in:
parent
1e95d5ba82
commit
40d8b6e28c
|
@ -1415,15 +1415,18 @@ definitions on forms <form-media-paths>`.
|
||||||
jQuery
|
jQuery
|
||||||
~~~~~~
|
~~~~~~
|
||||||
|
|
||||||
Django admin Javascript makes use of the `jQuery`_ library. To avoid
|
Django admin Javascript makes use of the `jQuery`_ library.
|
||||||
conflicts with user-supplied scripts or libraries, Django's jQuery is
|
|
||||||
namespaced as ``django.jQuery``. If you want to use jQuery in your own admin
|
|
||||||
JavaScript without including a second copy, you can use the ``django.jQuery``
|
|
||||||
object on changelist and add/edit views.
|
|
||||||
|
|
||||||
If you require the jQuery library to be in the global namespace, for example
|
To avoid conflicts with user-supplied scripts or libraries, Django's jQuery
|
||||||
when using third-party jQuery plugins, or need a newer version of jQuery, you
|
(version 1.4.2) is namespaced as ``django.jQuery``. If you want to use jQuery
|
||||||
will have to include your own copy of jQuery.
|
in your own admin JavaScript without including a second copy, you can use the
|
||||||
|
``django.jQuery`` object on changelist and add/edit views.
|
||||||
|
|
||||||
|
The :class:`ModelAdmin` class requires jQuery by default, so there is no need
|
||||||
|
to add jQuery to your ``ModelAdmin``'s list of media resources unless you have
|
||||||
|
a specifc need. For example, if you require the jQuery library to be in the
|
||||||
|
global namespace (for example when using third-party jQuery plugins) or if you
|
||||||
|
need a newer version of jQuery, you will have to include your own copy.
|
||||||
|
|
||||||
Django provides both uncompressed and 'minified' versions of jQuery, as
|
Django provides both uncompressed and 'minified' versions of jQuery, as
|
||||||
``jquery.js`` and ``jquery.min.js`` respectively.
|
``jquery.js`` and ``jquery.min.js`` respectively.
|
||||||
|
|
Loading…
Reference in New Issue