PDA

View Full Version : Reload page in frames


tpeck
01-08-2003, 09:14 AM
Dear everyone,

I am trying to reload a webpage (via a graphic link) using javascript.

I have a webpage made up of a top frame, main frame and bottom frame.

But my attempts only make the main (middle frame) reload.

How can I make the entire frame page reload?

My script so far is:

<a href="Reload" onclick="history.go(0);return false;">
<img border="0" src="../../img/Reload.gif" alt=" Reload Page " width="50" height="25">
</a>

So you can see that my method is: onclick="history.go(0);return false;"

It works! But how do you make the top and bottom frames also refresh/reload?

Many thanks,

Terry

glenngv
01-08-2003, 09:38 AM
if you want to reload the whole frameset, you need to use:

top.location.reload();

that would reload the frameset with the default src for each of the frames loaded again.

if you want to retain the original page in the main frame when you do the reload, then this should be the code:

<a href="Reload" onclick="

top.frames["nameOfTopFrame"].location.reload();
top.frames["nameOfBottomFrame"].location.reload();
top.frames["nameOfMainFrame"].location.reload();

return false;">
<img border="0" src="../../img/Reload.gif" alt=" Reload Page " width="50" height="25">
</a>

I just put the line breaks for readability.
If the link is in the main frame, you may change the 3rd line to this:

location.reload(); //or history.go(0) as you used

BTW, you should have edited your previous post rather than start a new thread. Just delete that previous post.

tpeck
01-09-2003, 12:22 AM
Dear Glenn,

Thank you for your very helpful reply - it will do the job I am sure.

Sorry if I did something wrong when posting my query - I don't know what I did wrong though - this is a new topic from me, so I thought I would start a new thread. Is that not correct?

I don't know what to delete, sorry.

Terry

glenngv
01-09-2003, 01:52 AM
is this a similar thread?

http://codingforums.com/showthread.php?s=&threadid=12594

tpeck
01-09-2003, 04:09 AM
Glenn - this is bizarre!

I have no explanation for the two threads.

As you can see, the times of the postings are way different:

09:02 AM and 1.14 AM

... and there seems to be a lot missing from the 'bogus' posting at 09:02 AM which I swear I did not make!

I really don't know where this posting came from - should I delete it? Maybe it will cause internal problems if I do, and besides, someone has replied to it - with very little to go on.

If I caused the double posting for whatever reason, I apologise, but it is a mystery to me how it occurred!

Terry