two frames load one link problem

Josh Simpson's picture

They have: 147 posts

Joined: Dec 1999

on my websight http://redrival.com/jls/school
I have frames
like so
+---+----------------------+
|nav|location============|
|===+----------------------+
|===|body==============|
|===|==================|
+---+----------------------+

i have got the home button t reload both the frames but as soon as it try to use the script on another button , i get an error
i am compleatly puzzeled
help Sad

Thanks Josh

[This message has been edited by Josh Simpson (edited 25 June 2000).]

JLS (Joshua Lee Simpson)

They have: 122 posts

Joined: Jun 1999

I'm not sure if I understand your question and coding ont he page, fully. Can you please explain in more detail

They have: 122 posts

Joined: Jun 1999

I dont' really see what's wron.g Could you explain your problem more, especially

quote:i have got the home button t reload both the frames but as soon as it try to use the script on another button , i get an error

Josh Simpson's picture

They have: 147 posts

Joined: Dec 1999

well from my first post you get the layout of the frames
i am using this script from the nav frame

funcition home()
{
parent.loc.location="location.htm"
parent.main.location="main.htm"
}

"loc" being on frame
"main" being the other

this us used for each of the buttons with the "home()" part changed and the location=" part changed
this is all located in a external ".js" file
linked into the html the file is http://redrival.com/jls/school/nav/nav.js
i also want to use the same file in the loc frame later on so the extrnal file is important.
I am only new to javascript, it it somthing rong with the frame names i am using of somthing else i dont know Sad

Please help

Josh

JLS (Joshua Lee Simpson)

Josh Simpson's picture

They have: 147 posts

Joined: Dec 1999

Well on my computer and my friends when i
click on the principal or staff button
IE5 comes up with a error on page box
saying "object expected" on "Chr 1, line 1"
but thge only thing that is on line one is the html <html>
is it just my computer or somthing?
josh
i dont realy know what else to say ?

JLS (Joshua Lee Simpson)

They have: 122 posts

Joined: Jun 1999

the errors might be associated with the fact that you have a target in those two HREF's. They wouldn't need a target. Also, I wouldn't use "location" as the name of your frame, but it still should work. Anyway, I put all the script in the main page and did away with your functions b/c I put them in the HREF's.

*NOTE THIS IS FOR THE NAVIGATION PAGE W/O NAV.JS*

<HTML>
<HEAD>
<TITLE>Welcome to Makoura College Online</TITLE>
<SCRIPT language="JavaScript">
browserName=navigator.appName;
browserVer=parseInt(navigator.appVersion);

if ((browserName=="Netscape" && browserVer>=3) | | (browserName=="Microsoft Internet Explorer" && browserVer>=4))
version="n3";
else
version="n2";

if (version=="n3")
{
pic1on= new Image(100,30);
pic1on.src="nav/home_in.gif";
pic2on= new Image(100,30);
pic2on.src="nav/principal_in.gif";
pic3on= new Image(100,30);
pic3on.src="nav/staff_in.gif";
pic4on= new Image(100,30);
pic4on.src="nav/tour_in.gif";
pic5on= new Image(100,30);
pic5on.src="nav/curriculum_in.gif";
pic6on= new Image(100,30);
pic6on.src="nav/whats_on_in.gif";
pic7on= new Image(100,30);
pic7on.src="nav/contact_us_in.gif";
pic8on= new Image(100,30);
pic8on.src="nav/in.gif";

pic1off= new Image(100,30);
pic1off.src="nav/home_out.gif";
pic2off= new Image(100,30);
pic2off.src="nav/principal_out.gif";
pic3off= new Image(100,30);
pic3off.src="nav/staff_out.gif";
pic4off= new Image(100,30);
pic4off.src="nav/tour_out.gif";
pic5off= new Image(100,30);
pic5off.src="nav/curriculum_out.gif";
pic6off= new Image(100,30);
pic6off.src="nav/whats_on_out.gif";
pic7off= new Image(100,30);
pic7off.src="nav/contact_us_out.gif";
pic8off= new Image(100,30);
pic8off.src="nav/out.gif";

}

function lightup(imgName)
{
if (version=="n3")
{
imgOn=eval(imgName + "on.src");
document[imgName].src= imgOn;
}
}

function turnoff(imgName)
{
if (version=="n3")
{
imgOff=eval(imgName + "off.src");
document[imgName].src= imgOff;
}
}
</SCRIPT>

<style type="text/css"><!--
span.nav {font-size: 8pt; font-style: normal; font-family: arial; font-weight: extra-light; color: #FFffff}
--></style>
</head>
<BODY bgcolor="#FFFFFF" link="#006666" vlink="#006666" text="000000" marginwidth="0" marginheight="0" topmargin="0" leftmargin="0" scrolling="yes" background="nav/side.gif">

<table width="125" bgcolor="#006666" borderdark="#FF0000" borderlightcolor="#FF0000" border="5" bordercolor="#ff0000" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" align="center" valign="middle"><span class="nav">  You Are Here >></Span></td>
</table>
<center>
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="115" valign="top" align="center">
<IMG SRC="nav/corner_shade.gif"><br>
<IMG SRC="nav/logo.gif"><br>
<A HREF="javascript:void(0)" onclick="parent.location.location='location/location.htm';parent.main.location='main.htm'" onMouseover="lightup('pic1')" onMouseout="turnoff('pic1')"><IMG SRC="nav/home_out.gif" name="pic1" border="0"></A><br><img src="nav/button_spacer.gif"><br>
<A HREF="javascript:void(0)" onclick="parent.location.location='location/loc_principal.htm';parent.main.location='p_message.htm'" onMouseover="lightup('pic2')" onMouseout="turnoff('pic2')"><IMG SRC="nav/principal_out.gif" name="pic2" border="0"></A><br><img src="nav/button_spacer.gif"><br>
<A HREF="javascript:void(0)" onclick="parent.location.location='location/loc_staff.htm';parent.main.location='staff.htm'" onMouseover="lightup('pic3')" onMouseout="turnoff('pic3')"><IMG SRC="nav/staff_out.gif" name="pic3" border="0"></A><br><img src="nav/button_spacer.gif"><br>
<A HREF="tour.htm" target="main" onMouseover="lightup('pic4')" onMouseout="turnoff('pic4')"><IMG SRC="nav/tour_out.gif" name="pic4" border="0"></A><br><img src="nav/button_spacer.gif"><br>
<A HREF="curriculum.htm" target="main" onMouseover="lightup('pic5')" onMouseout="turnoff('pic5')"><IMG SRC="nav/curriculum_out.gif" name="pic5" border="0"></A><br><img src="nav/button_spacer.gif"><br>
<A HREF="whats_on.htm" target="main" onMouseover="lightup('pic6')" onMouseout="turnoff('pic6')"><IMG SRC="nav/whats_on_out.gif" name="pic6" border="0"></A><br><img src="nav/button_spacer.gif"><br>
<A HREF="contact_us.htm" target="main" onMouseover="lightup('pic7')" onMouseout="turnoff('pic7')"><IMG SRC="nav/contact_us_out.gif" name="pic7" border="0"></A><br><img src="nav/button_spacer.gif"><br>
<A HREF="webmaster.htm" target="main"><img src="nav/webmaster.gif" border="0"></a>
</td>
</tr>
</table>
</center>
</BODY>
</HTML>

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.