Muppetmaestro,
You may want something like this:
index.html
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<title></title>
<script type="text/javascript">
origURL = parent.document.URL;
contentURL = origURL.substring(origURL.indexOf('?')+1, origURL.length);
if (top.location == contentURL)top.location.href='index.html?menu1.html';
</script>
<script type="text/javascript">
if(/*@cc_on!@*/false)
{//if IE
document.write('<iframe style="position:absolute;width:24%;left:2.5%;top:28%;height:400px;border:1px dashed red;background:#ffffff" frameborder=0 src="' + contentURL + '"><\/iframe>');
}
else
{
document.write('<object type="text/html" style="position:absolute;width:24%;left:2.5%;top:28%;height:400px;border:1px dashed red;background:#ffffff" data="' + contentURL + '"><\/object>');
}
</script>
</head>
<body style="font-family:verdana;font-size:12px;background:silver;padding-left:30%;padding-top:20%">
<div style="position:absolute;top:4%;left:30%;border:1px solid red;padding:15px;background:#ffffff">
<a href="index.html?menu1.html" >Load menu 1 and change main page</a><br>
<a href="index.html?menu2.html" >Load menu 2 and change main page</a><br><br>
<a href="menu1.html" onclick="frames[0].location.replace(this); return false">Load menu 1 and don't change main page</a><br>
<a href="menu2.html" onclick="frames[0].location.replace(this); return false">Load menu 2 and don't change main page</a> <br><br>
<a href="somepage.html">Go somewhere else</a>
</div>
CONTENT
</body>
</html>
menu1.html:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<title></title>
<style type="text/css">
html{overflow-x:hidden}
body{padding:10px}
</style>
</head>
<body >
MENU 1<br>
<a href="menu1.html" onclick="top.location.href=this">menu 1.html in its own window</a> <br>
<a href="menu2.html" onclick="top.location.href=this">menu 2.html in its own window</a> <br> <br>
<a href="menu1.html">menu 1.html in this very window</a> <br>
<a href="menu2.html">menu 2.html in this very window</a> <br> <br>
<a href="menu1.html" onclick="document.location.replace(this); return true">Load menu 1 and don't change main page</a><br>
<a href="menu2.html" onclick="document.location.replace(this); return true">Load menu 2 and don't change main page</a><br>
</body>
</html>
menu2.html
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<title></title>
<style type="text/css">
html{overflow-x:hidden}
body{padding:10px}
</style>
</head>
<body style="overflow-x:hidden">
<span style="color:red">MENU 2</span><br>
<a href="menu1.html" onclick="top.location.href=this">menu 1.html in its own window</a> <br>
<a href="menu2.html" onclick="top.location.href=this">menu 2.html in its own window</a> <br> <br>
<a href="menu1.html">menu 1.html in this very window</a> <br>
<a href="menu2.html">menu 2.html in this very window</a> <br> <br>
<a href="menu1.html" onclick="document.location.replace(this); return true">Load menu 1 and don't change main page</a><br>
<a href="menu2.html" onclick="document.location.replace(this); return true">Load menu 2 and don't change main page</a><br>
</body>
</html>
An object is used for non-IE. We have to use an iframe (deprecated) for IE (until they give better support for the object).
DEMO here.
===
Arie.
Bookmarks