unknown: Block Scope Problem

Beitrag lesen

Entweder packst du auch alles was re nutzt mit in das Callback, oder du gibst eine Promise zurück. Für Promises gibt es auch für ältere Browser JS-Libs und sicher auch schlankere Polyfills.

Und bei jQuery ist das xhr-Objekt selbst eine(eine? ein) Promise.