El escenario para mi aplicación javascript frontend es el siguiente:
Actualmente estoy probando el siguiente enfoque de interfaz:
const myElement = document.createElement('myElement'); myElement.setAttribute('src', 'https://.../file.html'); document.body.appendChild(myElement);Y file.html se parece a:
<html> <head> <script language="Javascript"> function doSomething() { } </script> </head> <body onload="doSomething()"></body> </html>Pero no pasa nada.
¿Me equivoco al esperar que en document.body.appendChild() , el archivo se descargue y ejecute como si la URL se abriera desde el navegador?