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

174
Views
¿Cómo cargar un html externo y sus archivos css con XMLHttpRequest?

Quiero cargar un html y sus archivos css en otro html con XMLHttpRequest() El problema es que el archivo html está cargado pero no su archivo css.

¿Es posible cargar el archivo para que se vea igual que el original?

Logré esto al cargarlo en un iframe de pantalla completa, pero me gustaría lograrlo sin el uso de un iframe.

 var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == XMLHttpRequest.DONE) { // XMLHttpRequest.DONE == 4 document.getElementById("myDiv").innerHTML = xmlhttp.responseText; } }; xmlhttp.open("GET", "myHtmlWithCss.html", true); xmlhttp.send();
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Prueba siguiente

 <object type="text/html" data="your-file.html" width="100%" height="100%" />

Tal vez necesite asignar "altura: 100vh;" con CSS adicional.

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!