#30299: Update AJAX Documentation getCookie Implementation
-------------------------------------+-------------------------------------
Reporter: Matthew | Owner: nobody
Pava |
Type: | Status: new
Cleanup/optimization |
Component: | Version: 2.1
Documentation | Keywords: ajax jquery
Severity: Normal | getCookie
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
The Django docs provide a very nice function to obtain the session cookie,
but it depends on jQuery being installed.
The code is here:
https://docs.djangoproject.com/en/2.1/ref/csrf/#ajax
We should remove the dependency on jQuery, and it looks like there's only
one line that needs to be updated.
Replace
`var cookie = jQuery.trim(cookies[i]);`
with
`var cookie = cookies[i].trim();`
str.trim() is [https://caniuse.com/#search=trim supported] in every modern
browser.
--
Ticket URL: <https://code.djangoproject.com/ticket/30299>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/049.017480aa4e50526c364f6277eef233f2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.