Forum Moderators: open
this is my frameset code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>M-Science SMS Server</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../styles/pc_ie.css" rel="stylesheet" type="text/css">
<frameset rows="235,*" cols="*" framespacing="0" frameborder="NO" border="0">
<frame src="header.html" name="topFrame" scrolling="no" noresize >
<frame src="signup.html" name="mainFrame" frameborder="no" marginwidth="0" marginheight="0">
</frameset><noframes></noframes>
</head>
<body align="center">
</body>
</html>
'signup.html is just a test page, but I want this frame to depend on where the user has just navigated from. What javascript shoul I use to do this? I have not used javascript much so if you could explain in simple terms I would really appreciate it!
Thanks in advance for any help!
<script language="javascript" type="text/javascript">
if(document.referer)
{
if(document.referer == "somepage"){
document.getElementByID("mainFrame").src="signup.html"
}
if(document.referer == "someotherpage"){
document.getElementByID("mainFrame").src="othersignup.html"
}
}
</script>
Then add ID's to your frames:
<frame src="header.html" id="topFrame" name="topFrame" scrolling="no" noresize >
<frame src="" id="mainFrame" name="mainFrame" frameborder="no" marginwidth="0" marginheight="0">
This would not work so well, as it depends on the referer existing. Your best bet would be to use PHP or some other server side scripting language, and pass in the page you want displayed as a variable.