Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

533
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!