Answers
Aug 30, 2006 - 02:12 AM
Cheers
Peter
Aug 30, 2006 - 06:40 AM
I don't remember the code for it...
Aug 30, 2006 - 07:20 AM
For example:
new link
Aug 30, 2006 - 07:47 AM
If you use this javascript in your framesets children pages, I believe it should work:
if (top == self)
{
location = 'parent_frameset_page.html';
}
Aug 30, 2006 - 07:43 PM
http://scriptasylum.com/tutorials/fra...
Aug 30, 2006 - 08:17 PM
Setting the taget of a link to _parent doesn't help. The question was, how can I force a page to be opened in its frameset if for example the page is found by Google etc. You can't influence the links on teh google serach results page! And by the way, _parent forces the browser to open a page in the same window as opposed in a new window.
But I was thinking about this problem. And I thought the only way could be, that you prevent the page to be loaded at all and redirect to it's parent page. But this has to be hardcoded in the page itself. So if you open the page, you have a java script which says "Hey, I am not supposed to be loaded directly, instead load MyParent.html". I found a script on this webpage: http://www.codelifter.com/main/javascript/openinframeset1.html
============================================================
Script: Open Page in Frameset Script
Functions: If a page is intended to be opened only within
a frameset, this script refers the browser
immediately to the frameset page
Browsers: All
Author: etLux
============================================================
Put the following script in the head of your page. Set the
url of the frameset page where shown below.
!
============================================================
I tested it and it works. But now I am confused. Because I don't know why it works. There is no relationship from child to parent, only Parent to child! The script even works if the child page is in a subfolder folder of the parent page. Even if it is part of another web site! So please explain someone to me how a child knows which page its parent is!!!
Cheers
Peter
Aug 30, 2006 - 08:29 PM
I believe it's the same as when you detect the opener from the page that was opened from another page.
Of course a page in itself opened directly has no idea of who is it's parent. But if it was called/opened in a frameset, it does know who the frame parent is. So basically you're asking from that page whether the page is in a frameset or not, and if it isn't it opens its parent page, which then opens the child page as it should.
Anyway, I would not recommend using frames unless you have some very good reasons for it. In general the disadvantages are bigger than the advantages.
Aug 30, 2006 - 08:30 PM
Add New Comment