PDA

View Full Version : links between frameset, iframe & ...



R@iny
02-21-2010, 08:47 AM
hi. sorry for my english.
i have a frameset. that has 2 frames. in evry frame 2 frames avaliable.
my ask: how can i links between frames of frame set and iframe. iframe to iframe and iframe too frame set?
i mean like this picture
http://smokish.com/images/t2a0e1h2197tun0j3cn.png

R@iny
02-21-2010, 08:55 AM
and how can i open a link from other page too a frame of frame set?
and how can i open a link from an iframe to main page?

jscheuer1
02-21-2010, 12:32 PM
As long as each of your frames and iframes have a unique name (not id), these should be able to be used as the target attribute of the link:


<a href="some.htm" target="frame_2">Something</a>

To open a link in an iframe to the page it is on, make the target _parent:


<a href="some.htm" target="_parent">Something</a>

To open a link from inside an iframe on a page inside a frameset to take over the entire window, use _top:


<a href="some.htm" target="_top">Something</a>

That's all just ordinary HTML.

To set the load of a specific page into a specific frame when a frameset or page is loaded, one could use a query, post, or session string in conjunction with a server side language like PHP or asp. Or javascript could be set to use a query string. Or using ordinary HTML one could have a separate frameset/page for each link that needs it.

But frankly, unless there is just no other way of organizing your content, the use of frames of any kind (iframe or frameset) is mostly just confusing to setup and to maintain, and can often limit the sort of scripts you can use.

R@iny
02-21-2010, 04:45 PM
for example what code of link between frame3 of FramesetFrame2 and Frame1 of FramesetFrame1 (like to picture)

and

what code of link between frame3 of framesetFrame2 and FramesetFrame1

and

what code of open a link from other page too a frame of frame set?

jscheuer1
02-21-2010, 10:15 PM
As I said, the drawback to organizing one's site like this is that it can quickly become confusing. First I would have to know the names of all of those frames, and exacltly what you would want to happen in whatever given one that you are talking about, by its name, when a given link is clicked.

But it's not quite so complicated as it might sound. And though I would advise against organizing one's site in this manner - say frameset one has an iframe in it by name of 'bob' and you want a link on a page in an iframe on a page in frameset two to place an image in 'bob':


<a href="some.jpg" target="bob">Some Image</a>

This assumes that there is no other frame or iframe with a name attribute of 'bob'. It gets tricky though because it also assumes that the 'bob' iframe exists, which could be hard to be certain of. You really can have no guarantee about how folks get to the page with that link on it. But the worst that could happen is that the image would open instead in a new window/tab or be blocked. As long as you think it through though, most folks would probably be in the framesets you envision with the pages loaded as expected for it to work like you want. I just don't happen to be a big fan of of pages that only work most of the time.

If you want more help, please post a link to an example and describe exactly what you want to have happen that isn't.

R@iny
02-22-2010, 10:50 AM
please use simply because my english is too bad.
it is sample file http://rapidshare.com/files/354172654/Frames.zip.html

jscheuer1
02-22-2010, 02:48 PM
Here it is all fixed up like I think you want it:

3162

R@iny
02-23-2010, 11:29 AM
thank u.
an answer:
i have a page. it have a link. i need to open this link to Frameset-frame1.

Notice: this page no has frame set. it open in different page(that has a frameset)
how can i?

jscheuer1
02-23-2010, 02:45 PM
The easiest way is to make up a new frameset page that has this page as its src attribute for Frameset-frame1 named frame.

Then, instead of linking to the page you want to be in the frameset, link to this new frameset page which already has the page where you want it to be.

A javascript can be placed on the page in the new framset to load the new frameset if the page is navigated to by itself. But this shouldn't be relied upon, as many folks have no javascript. It's just a nice touch.

Alternatively, if you have PHP*, the frameset may be a PHP page that you pass the page to be loaded into the frameset via a get, post, or session string variable.


*Other server side languages like asp, etc. may be used for this as well. PHP is the most popular.