Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

251
Visualizações
Why am I getting a CORS error from just a simple Settimeout function in javascript?

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: Firefox Cors Error

Microsoft Edge Cors Error

Thanks in advance for your help.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

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!

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda