Link to home
Start Free TrialLog in
Avatar of arichee
arichee

asked on

meta refresh to top

How would I code a meta refresh to the top of another page?  It doesn't appear that the meta tag allows a target option.  Is there a way in javascript?
Avatar of andriv
andriv

do you mean top frame or just to go to another page and start from the top?  If you are looking to simply go to another page and start from the top you do not need a target because it should always start at the top.  If you want to go to another page and start from a specific spot then you need two things.  First lable the target:


<a name="here">

then on the page you want to refresh from you would use the meta refresh with the # before indicating the targeted spot:

<meta http-equiv="refresh" content="2;URL=http://www.domain.com/test2.htm#here">

If it's for frames then I don't know.
You could use Javascript like this:

To refresh a specific window:
windowName.location.reload();

Refresh this window:
location.reload();

If "this" page is a part of a frame, you refresh the frame like this:

top.location.reload();

To reload an other frame than the one we're in :

top.frames[0].location.reload();

Or if you want to wait:

setTimeout("windowName.reload()",2000);

This waits 2 seconds before reloading the window named "windowName".
Avatar of arichee

ASKER

The HREF is within a child within a frameset, and I want to meta refresh to entirely new frameset.
ASKER CERTIFIED SOLUTION
Avatar of pagemastah
pagemastah

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial