<!DOCTYPE html>
<html language="en">
<head>
<title>a.com</title>
<script language="javascript">
function onLoad() {
// The embedded iframe is dynamically loaded because we don't know
// the port where it is hosted until runtime.
console.log("a_embeds_a.html loaded");
let l = window.location;
let url = `${l.protocol}//a.com:${l.port}/a.html`;
console.log(`loading iframe [${url}]`);
let iframe = document.createElement('iframe');
iframe.setAttribute('src', url);
document.body.appendChild(iframe);
}
</script>
</head>
<body onload="onLoad();">
Welcome to a.com, embedding a.com!
</body>
</html>