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

532
Visualizações
Cross-origin read blocking (CORB) blocked the cross-origin response with MIME type text/html

I have a js file named get-chat.js that calls a function every 1 second:

setInterval(function () {

    //start ajax
    let xhr = new XMLHttpRequest(); //creating XML object
    xhr.open('POST', 'get-chat.php', true);
    xhr.onload = () => {
        if (xhr.readyState === XMLHttpRequest.DONE) {
            if (xhr.status === 200) {
                let data = xhr.response;
                chatBox.innerHTML = data;
            }
        }
    }

    //send the form data through ajax to php
    let formData = new FormData(form);
    xhr.send(formData);
}, 1000);

this function executes an XML Ajax call that redirects to the get-chat.php page, which retrieves all messages with certain characteristics from a database.

As long as this script is executed on a localhost, everything works correctly. When the script is loaded on a web host (not localhost) I receive the following error:

Cross-origin read blocking (CORB) blocked the cross-origin response with MIME type text/html

I have already looked for information on CORB, but I cannot figure out how to solve it.

Can anyone help me? Thanks

PS: chatBox is a variable declared outside the function

UPDATE:

I add the response headers and payload as requested

response headers

payload

about 4 years ago · Juan Pablo Isaza
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