Everything is working fine in Chrome the problem is with FireFox and Microsoft Edge. With these two browsers I keep on getting CORS errors. I am making no API calls in this website. All this function that is causing this error is doing is resetting the opacity of some text I hid back to 1.
This is the function that is causing the error:
setTimeout(() => {
opacityP.style.opacity = 1;
opacityB.style.opacity = 1;
}, 3000);
This are the error message from FireFox and Microsoft Edge:
Thanks in advance for your help.
I think it's not possible to access local script files at the browser level. You can run the code through a local server like localhost:3000 or so. Xampp or Wamp would work for you. If you're using VS Code, you can use their extension. https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer
Hope this helps you!