I have already gotten my project to work on with async/await in every other browser, but apparently its not compatible in IE.
(async function () {
try {
await getLayers();
}
catch (err) {
console.error(err)
}
}());
which calls my other function:
async function getLayers() {
try {
$.when(
await $.getJSON('http://' + ipAddress + '/api/Barriers/barrierGeoJSON', function (data) {
createLayer(data[0].row_to_json, 'Barrier');
}),
await $.getJSON('http://' + ipAddress + '/api/DistPoints/distPointGeoJSON', function (data) {
createLayer(data[0].row_to_json, 'Disturbance Points');
})
)}
catch (err) {
console.error(err);
}
};
I need help getting this code to run on IE. Is there some sort of polyfill or transpiler that I have to use? I would hate to have to rewrite everything when it already runs smoothly. This is currently running client-side and I could not figure out how to use async--await. Thank you guys in advance.
I ended up using babel to convert this portion of my code to work with IE11. Also I had to import a polyfill so the regeneratorRuntime function will work.
It became this which works across all browsers: