This one is mine:
https://github.com/donohoe/content/blob/master/posts/javascr...
(I follow basic ES6 syntax but easy to switch as needed)
Edit: To clarify, a drop in replacement is what I was looking for.
https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
fetch("http://www.example.com").then(res => res.json()).then(json => {})
fetch(url, { method: “POST”, body: “a body” })
https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequ...
I don't know how far back it will help with old browsers. I'd need to test that and it will take awhile.
JSON.parse will throw a few older browsers by itself.
This one is mine:
https://github.com/donohoe/content/blob/master/posts/javascr...
(I follow basic ES6 syntax but easy to switch as needed)