JS: "use strict" und jQuery(document).ajaxSend()

Alles, was nicht direkt mit Python-Problemen zu tun hat. Dies ist auch der perfekte Platz für Jobangebote.
Antworten
Benutzeravatar
jens
Python-Forum Veteran
Beiträge: 8502
Registriert: Dienstag 10. August 2004, 09:40
Wohnort: duisburg
Kontaktdaten:

Hab gemerkt das der JavaScript code von https://docs.djangoproject.com/en/dev/r ... csrf/#ajax nicht funktioniert, wenn man "use strict" setzt.

Dabei ist es wohl so, das die Funktion durch .ajaxSend() überhaupt nicht aufgerufen wird. Bsp:

Code: Alles auswählen

jQuery(document).ajaxSend(function(event, xhr, settings) {
    log("ajaxSend...");
});
Offene bugs in jQuery sind nicht gemeldet: http://bugs.jquery.com/search?q=%22use+ ... &ticket=on

Weiß jemand woran es liegen könnte?
"use strict" einfach nicht setzten?

GitHub | Open HUB | Xing | Linked in
Bitcoins to: 1JEgSQepxGjdprNedC9tXQWLpS424AL8cd
sma
User
Beiträge: 3018
Registriert: Montag 19. November 2007, 19:57
Wohnort: Kiel

Die Dokumentation sagt:
The global option prevents handlers registered using .ajaxSend(), .ajaxError(), and similar methods from firing when this request would trigger them. This can be useful to, for example, suppress a loading indicator that was implemented with .ajaxSend() if the requests are frequent and brief. With cross-domain script and JSONP requests, the global option is automatically set to false. See the descriptions of these methods below for more details. See the descriptions of these methods below for more details.
Könnte es daran liegen?

Stefan
Benutzeravatar
jens
Python-Forum Veteran
Beiträge: 8502
Registriert: Dienstag 10. August 2004, 09:40
Wohnort: duisburg
Kontaktdaten:

Gute Frage... Vielleicht sollte man es eh besser so machen, das man Explizit eine Funktion nutzt, die "X-CSRFToken" einfügt.

GitHub | Open HUB | Xing | Linked in
Bitcoins to: 1JEgSQepxGjdprNedC9tXQWLpS424AL8cd
Antworten