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

105
Visualizações
XHR request response is an HTML object. How can I keep it and display it the way it is?

I have a server-side xQuery which transforms an XML file into an HTML document. I want to send a request behind the scenes to that xQuery, get the HTML back, and inject it in my page, obviously retaining all the structure as it is without parsing it or traversing the nodes again.

        function loadXSLtoHTML () {
             document.getElementById('xslt-transformation').innerHTML = this.respinseXML
           }
           
           var oReq = new XMLHttpRequest();
           oReq.addEventListener("load", loadXSLtoHTML);
           
           oReq.open("GET", "xquery generating HTML");
           oReq.responseType = "document";
           oReq.send();

I know about the limitations of XHR calls. Is there really not a way of keeping my response HTML and injecting it as it is?

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

0

Thanks to this answer, I solved with fetch():

const url = my transformation URL";
fetch(url)
  .then(
    response => response.text()
  ).then(
    text => document.getElementById('xslt-transformation').insertAdjacentHTML('beforeend', text)
  );
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