Load page and its iframe

Each of the following links will load page 2 which contains an iframe, each link will load a different page into that iframe

Iframe page 1
Iframe page 2
Iframe page 3

In this page

< href="page2.htm?iframepage1.htm">Iframepage1</a>
< href="page2.htm?iframepage2.htm">Iframepage1</a>
< href="page2.htm?iframepage3.htm">Iframepage1</a>

In page2.htm

<HTML>
<HEAD>
<TITLE>Load page and its iframe</TITLE>

<script type="text/javascript">
<!--

function loadIframe(){
if (location.search.length > 0){
url = unescape(location.search.substring(1))
window.frames["myiframe"].location=url
}
}

onload=loadIframe

//-->
</script>

</HEAD>
<BODY>
<h1>Load page and its iframe</h1>

<iframe name="myiframe" id="myiframe" src="" style="width:500px;height:400px"></iframe>

</BODY>
</HTML>