#30299 closed Cleanup/optimization (fixed)
Remove jQuery dependency from getCookie() function in CSRF docs
| Reported by: | Matthew Pava | Owned by: | nobody |
|---|---|---|---|
| Component: | Documentation | Version: | 2.1 |
| Severity: | Normal | Keywords: | ajax jquery getCookie |
| Cc: | Triage Stage: | Ready for checkin | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | yes | UI/UX: | no |
Description
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 supported in every modern browser.
Change History (3)
comment:1 by , 7 years ago
| Summary: | Update AJAX Documentation getCookie Implementation → Remove jQuery dependency from getCookie() function in CSRF docs |
|---|---|
| Triage Stage: | Unreviewed → Ready for checkin |
comment:2 by , 7 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
In ffdacc58: