How to use axios or fetch to support IE7

464 Views Asked by At

I am trying to make ajax request to backend using axios and fetch. However, seems like neither of them does not support IE7. Does anyone know if there is a quick way or package that I can use in order to avoid to rewrite all my code to using jQuery instead?

1

There are 1 best solutions below

0
Yunyu L. On

You need a ES6 Promise polyfill, as detailed in the readme for axios: https://github.com/axios/axios#promises

They suggest using es6-promise, and you can polyfill it globally by adding require('es6-promise/auto') to your initialization code.