HTML Code: 'Leave Frames'-Close first of two frames and open second frame only.
-
Subject: what is the code to LEAVE FRAMES (not target="_top" variations) to WHATEVER page is open in second frame? This HTML question will be super easy to answer for someone who knows the answer. I'm just having a hard time tracking it down. I use FrontPage 2000, so my HTML programming ability is limited. QUESTION CONTEXT: I have a two-frames set-up where the top frame contains navigation information, and the bottom frame is a given page within a target site. I need to have a 'leave frames' hyperlink in the top frame that will take the person to the second page by itself, whatever that page is at the time. The target="_parent" or target="_top" commands are not what I'm looking for, because they require that a URL be specified in the link. Two examples of where I want to use this feature are: http://www.sterlingdallan.com/jjdewey/offsite/books/immortal.htm and http://www.sterlingdallan.com/jjdewey/offsite/themes/beast.htm The purpose of the top frame is to give the users a route back to the main site. But within the bottom frame will be a wide array of pages. I want the user to be able to click on the "leave frames" button (defined by a single code), and have the current page in the bottom frame open alone into their browser. That generic code is what I want. I'm sure there is a simple solution to this. I just haven't been able to find it. I'm guessing that the solution is going to look something like this (the following code is an actual working sample used for another application). <a onclick="href='http://web.archive.org/web/*/'+location.href" href="http://www.greaterthings.com">Page History</a> Clicking on this link opens an archive.org version of whatever page is open at the time on my site. Very simple code for a fairly complex operation. There has to be something like this for the "leave frames" function I'm seeking. I just can't find it. Your help would be appreciated. Thanks
-
Answer:
There is a way to do it, but with the security-conscious nature of many modern browsers, it will only work if the site in the bottom frame is within the same domain as the top frame and the frameset. This is because the standard security settings of modern browsers don't allow frames to access variables relating to other "remote" frames or windows (this is to prevent sites from "tracking" you). Supposing both the top and bottom frames are within your domain, you may use the following tag: <a href="#" onClick='parent.location.href=parent.main.location.href;return false;'>close top frame</a> This assumes you've named the bottom frame "main", which I believe you've done. Unfortunately, if the bottom frame is in a different domain and the user hasn't lowered his browser's security settings, the only solution you have is to use a hardcoded URL in the link with a "_top" target. This unfortunately won't take them back to where they've last surfed, only the first page you linked them to. Notice that About.com does this [http://classiclit.about.com/gi/dynamic/offsite.htm?site=http%3A%2F%2Fwww.uic.edu%2Fjaddams%2Fhull%2Fja_bio.html]. They link to off-site pages with a top frame, and offer an option to "turn off this top frame", but if you've clicked through several links in the bottom frame, it loses your position in the site, taking you back to the first page to which it linked. I'm sorry that this doesn't offer you an ideal solution, but I hope I've adequately explained your options to you. Let me know if you need anything else. --Joey
askreceive-ga at Google Answers Visit the source
Related Q & A:
- How can I add a HTML code to My Yahoo homepage?Best solution by Yahoo! Answers
- If I would like to close one of two e-mail addresses with yahoo would that be possible?Best solution by Yahoo! Answers
- What is the HTML code to make your web more accurate?Best solution by Yahoo! Answers
- How do I put an html code in a scroll box?Best solution by html.am
- What's the HTML code for a scroll box on top of a picture?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.