View Single Post
Old 04-04-2003, 01:50 AM   #11 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,726
redhead is on a distinguished road
Ok, if this is still an object.. then this is what I would do:
Code:
<html>
<head>
 <title>
  Your title 
 </title>

<script language="JavaScript">
<!--- hide from nasty NS 2.0

var urlArray = new Array("main.html", "firstpage.html",
secondpage.html", "thirdpage.html");

/*
 * this is a simple function to decide main contence,
 * given a url like: url/&something it will give the main contence
 * something.html
 * unless its a special something like lovene etc..
 */

function decideMain(url){
  var INDEX = url.indexOf("?");
// if a regular url no need to play the BIG boss here..
  if(INDEX == -1)
    return "main.html";
  var searchThing = url.substring(INDEX+1);
  for(var i = 0; i < urlArray.length; i++)
    if(urlArray[i].indexOf(searchThing) > -1)
      return urlArray[i];

// if everything fails.. we can return the something.html page..
  return (searchThing + ".html");
}

var MAIN = decideMain(document.location.href);

document.write(
"<FRAMESET ROWS=\"*, 135\" noresize border=\"0\">\n" +
"  <FRAME NAME=\"main\" SRC=\"" + MAIN +"\" noresize SCROLLING=\"auto\" border=\
"0\">\n" +
"  <FRAME NAME=\"menu\" noresize SRC=\"menu.html\" SCROLLING=\"no\" border=\"0\"
>\n" +
"</FRAMESET>\n"
);
// End of hiding..  -->
</script>
<!--- For those who cant even allow javascript.. -->
<noscript>
<FRAMESET ROWS="*, 135" noresize border="0">
  <FRAME NAME="menu" noresize SRC="menu.html" SCROLLING="no" border="0">
  <FRAME NAME="main" SRC="main.html" noresize SCROLLING="auto" border="0">
</FRAMESET>
</noscript>
<!--- If your using IE 2.0 or older, it's just too bad.. -->

</head>
<body BGCOLOR="#FFFFFF" ALINK="#0099FF"  LINK="#0099FF" VLINK="#0099FF" TEXT="#0
00000" TOPMARGIN="16" LEFTMARGIN="16" MARGINWIDTH="16" MARGINHEIGHT="16">
<center>
<table border="0" cellspacing="0" cellpadding="0" width="90%">
 <tr>
  <td>
   Too bad, your browser dosn't support frames
  </td>
 </tr>
</table>
</center>
</html>
It will do what the description of the function is telling..
Just make your image map to parse the desired thing, like <a href='my_frame.html?what_to_se'> and it will load your fram-page with the main contence beeing 'what_to_see.html', if the '?wat_to_se' should match anything mentioned in the urlArray, it will load the mainsource as beeing the match. If you parse it with the usual <a href='my_frame.html'> it will just load main.html as the main source..

Hope this is what you were looking for, and I'm sorry I didnt answer it sooner, eventho I was aware of this..

But as the others claim, frames are bad..... Use php, and just have a show_menu() function you just call from what ever page you need it shown in..

Then again, if you havn't got the support for php you're forced to use frames.. (but frames are bad...)
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote