Forum Moderators: open
The page to be framed should open the index page with a query string containing the address of the page to be framed (unless it already resides in a frameset):
<script type="text/javascript">
if (top == self) location = "index.html?frPage=thispage.html";
</script>
In index.html, the idea is to have the whole frameset written by script and to insert the page to be framed:
<script type="text/javascript">
var frPage = location.search.substr(8);
frPage = frPage.length > 0? frPage : "homepage.html";
document.write('<frameset rows="50, *">');
document.write(' <frame src="top.html">');
document.write(' <frame src="' + frPage + '">');
document.write('</frameset>');
</script>
That's it, basically. You'll probably want to include <noframes> and <noscript> sections.