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

285
Views
¿Por qué no se ejecuta la secuencia de comandos de un archivo html obtenido?

He estado tratando de trabajar en esto, pero no llegué a ningún progreso sobre este tema. La secuencia de comandos del archivo html obtenido no se ejecuta, como puede ver aquí, tiene una secuencia de comandos que debería cambiar el color del cuerpo cuando lo busco, pero eso no sucede, sin embargo, los estilos funcionan bien.

¿Alguien puede decirme por qué esto no funciona?

Índice HTML

 <!DOCTYPE html> <html> <body> <script> fetch("Onload.html") .then((response) => { return response.text(); }) .then((html) => { document.body.innerHTML = html; }); </script> </body> </html>

HTML obtenido

 <p>HELLO WORLD!</p> <script> document.body.style.backgroundColor='green' </script>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Sin jquery! Aquí está cómo hacerlo amigos

índice html

 <!DOCTYPE html> <html> <body> <script> fetch("Onload.html") .then((response) => { return response.text(); }) .then((html) => { document.body.innerHTML=html; }); fetch('onload.js') .then(response => response.text()) .then(txt => { var script = document.createElement("script"); script.innerHTML = txt; document.body.appendChild(script); }); </script> </body> </html>
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!