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

408
Visualizações
xhttp is not defined when using ajax calls into an iframe

Good day all, I'm developing a php page in which there is an iframe, that opens another php page with a checkbox in it, this second page, when the user click on the checkbox, has to make an ajax call to confirm the "click".

so there is pageA.php, with a iframe in it that points to pageB.php, in this one, there is only a form with a checkbox and a javascript (vanilla javascript), that sould call a third page on click.

this is the javascript I'm using to send the "click":

document.getElementById("checkboxMe").onclick = function() {
    xhttp.open("POST", "pageC.php", true);
    xhttp.send("foo=bar");  
    };

when clicking on the checkbox, this is what I see on the console:

Uncaught ReferenceError: xhttp is not defined

it never happen something like this, infact I can't find this error easily on google, does anyone has some clues? maybe is the fact I'm into an iframe? how could I solve this issue?

thanks in advance ppl.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

xhttp is not a browser built-in. If you don't define it yourself then it won't be defined. Frames are irrelevant to that problem.

Perhaps you intended to first:

var xhttp = new XMLHttpRequest();
over 4 years ago · Santiago Trujillo 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