Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Using Meta HTTP-EQUIV=Refresh with frames and target="_top"

Posted on 2006-10-20
Medium Priority
Last Modified: 2008-01-09
I'm stuck on something that may well be easy.  I am using a refresh tag like the one below within a frame:


I would like to be able to have this refresh automatically go to the top level and thereby eliminate all of the frames.  I can do this within a form statement or via a URL using target="_top" as in the example below:

<a href="HTTP://" target="_top"> </i>Finished</a>

I can't seem to figure out how to properly format the target="top" within the Meta tag to work.  Is there a way to do this or some straight forward HTML equivalent?  If standard HTML can't do it, are there other simple options?


Question by:Mike93110
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
LVL 54

Accepted Solution

b0lsc0tt earned 2000 total points
ID: 17775320

The META tag does not take a target.  However it sounds like you are entering this meta tag in the html for one of the frames instead of the html of the page that sets up the frames.  Put the META tag in page that sets up the frames.

If you can't do that then you can try to use the body tag and javascript below.

<body onload="top.document.location='';">

Let me know if neither option will work.  Let me know if you have any questions or need more information.


Author Comment

ID: 17775401
Hi b0lsc0tt,

Thanks.  A quick test shows that the body tag may work for us.  I'll test it out more thoroughly this morning and if the implementation solves our issue, I'll get accept your response within the next few hours.

Thanks again for the quick response and straight forward solution.

LVL 54

Expert Comment

ID: 17775412
Your welcome!  Let me know if there is an issue or if you need more info and how the test works out.

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.


Author Comment

ID: 17776370

That did give us the solution for which I was looking.  Let me know if you'd like me to ask either of the following as new questions.

1) We have two frames.  One has a form statement with input fields.  When the uses enters information into the input frame we'd like the second window to refresh itself.  Is there a simple way to do this by adding some code to the first window with the input field without reloading all the frames including the top frame?  If the body tag onload is the simplest option and assuming that the second window's name was Win2 what would I need to change the top.document.location to (e.g.,  Win2.document.location)?

2) Also if the Win2 frame had a scroll bar and the user had scrolled  halfway down the frame, is it possible to easily refresh their page and return them to the same scroll point.  If that is possible wthout too much programming but it would be more appropriate to ask to ask that as new question, just let me know that it is possble and I'd be happy to ask it as a new question.

Thanks again,

LVL 54

Expert Comment

ID: 17777060
Your welcome!  I'm glad the test did what you wanted.

1. Are you submitting the form?  If so the quick answer is to make the second window the target.  That will cause it to be refreshed when the form is submitted.  Depending on the situation it may not work for what you have on the pages but it is the easiest way.  The form tag below is an example of how you could do it (notice the target attribute).

  <form method="post" action="filename.asp" target="frameWindowName">

2. Most browsers will return to the same portion of the page if the user clicks or initiates the refresh.  However to do it in programming you would need some way to know where they are and to put them back.  Named anchors (e.g. <a name="part2"></a>) in your html is one way to "name" sections.  A url can go to that specific section using #name (e.g. <a href="page.htm#part2">Go to part2</a>).  In Javascript you can use focus to go to a specific form field but I don't know if that would work in this case.  Is there something to "focus" on and how would you know what it is?

Both of these deserve their own new questions.  My reply to one may be enough so you don't need a question for it but the second one is more involved and we would need more details.  Even clever programming may not be able to do the second one.  Feel free to post a follow up here if you have some question about this comment.  I will keep an eye open for the new questions if you post them or you could post the URL here (if with in the next few days) to notify me.  I hope this helps!

Author Comment

ID: 17777208
Thanks for the help.  I'll try one and if that doesn't work I'll post a new question for it.  It sounds like two may be a bit trickier.
LVL 54

Expert Comment

ID: 17777231
> It sounds like two may be a bit trickier
Yeah, but not necessarily impossible.  It just depends on the specifics.  It can be very easy under the right circumstances.

I'm gald that I could help you.  Thank you for the grade, the points and the fun question.


Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question