Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

531
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda