3 ms·
One can use postMessage but if everything lives on the same domain one can top.frames["left"] in stead of window and call functions or manipulate the dom. You
by 6510 5y ago
One can use postMessage but if everything lives on the same domain one can top.frames["left"] in stead of window and call functions or manipulate the dom.
You had me play with framesets for a bit.
document.write((function(){switch(window.name){
case "main": switch(location.search){
case "?foo": return `<base target="top"></head><body>Article text`;
default: return `no article selected`;
}
case "menu": switch(location.search){
case "?bar": return `<base target="main"></head><body>List of <a></a>'s`;
case "?youtube": return `<base target="main"></head><body><list of youtube.com/embed/ links`;
default: return `please make your selection on the left`;
}
case "left": return `<base target="menu"></head><body> list of <a href="?youtube"> links`;
default: return `
<frameset cols="15%,85%">
<frame name="left" src="index.html" />
<frameset rows="30%,70%">
<frame name="menu" src="index.html" />
<frame name="main" src="index.html" />
</frameset>
</frameset>`;
}})());
I laughed so hard writing that.