Replace jQuery old-style ajax calls with Promise interface
As part of removing jQuery (#23022 (moved)), we need to replace the jQuery old-style Ajax calls with the jQuery Promise interface (Deferred objects).
This is suggested as getting rid of all jQuery Ajax calls is delayed as mentioned in #24011 (moved).