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

98
Views
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 answers
Answer question

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 Report
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!