1
0
mirror of https://github.com/django/django.git synced 2025-04-01 12:06:43 +00:00

[1.8.x] Recommended the JavaScript Cookie library instead of jQuery cookie.

jQuery cookie is no longer maintained in favor of the JavaScript
cookie library. This also removes the jQuery dependency.

Backport of f9de1972685ab5ab31ce483a297d85d3e119088b from master
This commit is contained in:
Marc 2015-08-19 14:29:02 +02:00 committed by Tim Graham
parent 79bd15ef32
commit 3fa5229600

View File

@ -114,12 +114,12 @@ Acquiring the token is straightforward:
}
var csrftoken = getCookie('csrftoken');
The above code could be simplified by using the `jQuery cookie plugin
<http://plugins.jquery.com/cookie/>`_ to replace ``getCookie``:
The above code could be simplified by using the `JavaScript Cookie library
<https://github.com/js-cookie/js-cookie/>`_ to replace ``getCookie``:
.. code-block:: javascript
var csrftoken = $.cookie('csrftoken');
var csrftoken = Cookies.get('csrftoken');
.. note::