How to deal with URLSearchParams compatibility?

the following code:

    var params = new URLSearchParams();
    params.append("kssj", kssj);
    params.append("jssj",jssj);
    axios.post("/api/php/history/carList.json",params).then((res)=>{...}
    

all the demo I write uses URLSearchParams to bind variables, but when this thing is released by demo, it will be opened with ie on other computers, showing that URLSearchParams is not defined. Is there any way to solve its compatibility?


just add a babel.

  

index.js is the entry js file? Still use post request page, why I use your method did not solve, but ie continues to report an error, promise is not defined

Menu