You might want to consider to make this a bit more modern with the Fetch API 😉 it’s much easier then the XMLHttpRequest
and it is promised base too.
I created a post about it if you want to see more: https://medium.com/better-programming/from-xhr-to-fetch-with-async-await-on-the-finish-line-b021de1d226b
For the rest, great post Louis de Bruijn 🤗