Click to See Complete Forum and Search --> : window.location.reload(true) does not reload all frames?


registering
08-15-2003, 11:28 AM
Howdy y'all!

I've got a website with 2 frames: left and right.

I want to click on a link in the leftframe and have the entire page -- everything -- reload, as if the user went to the page for the first time.

window.location.reload(true) seems to reload the left frame, but not the right frame. :(

I even tried parent.mainFrame.location.reload(true), where "mainFrame" is the name of the right frame, with no luck.

When clicked, the browser reloads the left frame, but not the right.

I would still like to cache the page, but I don't want to use the cache when I reload the page explicitly. For example, if I goto the URL location textfield in the browser window and just hit ENTER, everything reloads properly. I want this to happen when I click a link (not a button, I like a normal link).

This is using NS 7.1 and Safari 1.0 on Mac OS X. Any ideas?

This is the relevant code:



index.html:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>NERR Telemetry</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<!-- the leftframe is 140 pixels hardcoded. the rightmost column is whatever's left -->
<frameset cols="140,*">
<frame src="./pages/leftframe.html" name="leftFrame" frameborder="0" scrolling="no" noresize marginwidth="0">
<frame src="./pages/workaround.html" name="mainFrame" frameborder="0" >
</frameset>
<noframes>
Unfortunately your browser does not support frames
</noframes>
</frameset>
</html>



leftframe.html:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Navigation</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="frame.css" rel="stylesheet" type="text/css">
</head>

<body bgcolor="#FFFFCC">

<center><table>
<tr>
<td><center><img src="../pics/nerr.jpg" width="101" height="114"></center></td>
</tr>

<tr>
<td>&nbsp</td>
</tr>

<tr>
<td>&nbsp</td>
</tr>

<tr>
<td>&nbsp</td>
</tr>

<tr>
<!-- <td><center><input type=text onClick="window.location.reload()">Home</input></center></td> -->
<td><center><a href="../index.html" onClick="window.location.reload(true); parent.mainFrame.location.reload(true)">Home</a></center></td>
</tr>

<tr>
<td>&nbsp</td>
</tr>

<tr>
<td>&nbsp</td>
</tr>

<tr>
<td>&nbsp</td>
</tr>

<tr>
<td><center><a href="../index.html" onClick="window.location.reload(true); parent.mainFrame.location.reload(true)">Data Graphs</a></center></td>
</tr>

<tr>
<td>&nbsp</td>
</tr>

<tr>
<td>&nbsp</td>
</tr>

<tr>
<td>&nbsp</td>
</tr>

<tr>
<td><center><a href="./help.html" target="mainFrame">Help</a></center></td>
</tr>

</table></center>
</body>
</html>

Khalid Ali
08-15-2003, 11:39 AM
that is because you are reloading only the frame where you have the button/link.
you need to user something like this to load the parent

parent.location.reload(true);

registering
08-18-2003, 02:18 PM
Thanks Khalid Ali! Using the parent.location.reload(true) solved my problems for NS and IE but Safari doesn't handle it properly -- you can tell it's loading stuff into memory, but never actually updates the frame, so I think I'll submit a bug report. Thanks again!

Khalid Ali
08-18-2003, 02:44 PM
;)
My pleasure