refreshing a sibling (?) frame works depending on the browser

J

jazzdman

Hi,
I have the following JavaScript and HTML in a frame set. I want to
be able to reload a sibling frame with content depending on the button
the user presses and change the text style for the button the user
pressed as a visual queue as to what the contents of the sibling frame
are. This code works the way I want it to in IE, the frame in which
this code resides does not get reloaded every time the user presses a
button. However, if I try this code in Firefox, the frame that this
code lives in actually does get reloaded every time the user clicks on
a button. Where is my error? Is IE or Firefox behaving correctly?

Thanks,

Jason Mazzotta

<html>
<head>
<script language="javascript">
function setContent(b)
{
var els = document.forms[0].elements;
var loc = "/thesis_project/"+b.value+"/"+b.value+".jsp";

//Set the anchor that we just clicked on bold, and all
//others normal
for(i = 0; i<els.length; i++)
{
if(els.value == b.value)
els.style.fontWeight = "bold";
else
els.style.fontWeight = "normal";
}

parent.content.location.href = loc;

}
</script>
</head>
<body onLoad="alert('I\'ve been loaded');">
<table width="100%">
<form>
<tr>
<td><button onClick="setContent(this);" value="collect_display"
/>collect_display</button></td>
<td><button onClick="setContent(this);" value="compose_deliver"
/>compose_deliver</button></td>

<td><button onClick="setContent(this);" value="client_admin"
/>client_admin</button></td>
<td><button onClick="setContent(this);" value="search"
/>search</button></td>
</tr>
</form>
</table>
</body>
<html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top