Click to See Complete Forum and Search --> : Targeting a parent from within an iFrame


nathan12343
09-13-2005, 06:51 PM
Hi. I'm trying to use a link within an iFrame to change the content of the parent page. Easy enough... BUT the tricky thing (or perhaps impossible?) is that I want that link to be relative to the parent page not the iFrame's content page.

Does anyone know how I could do this - or confirm it's impossible so I can find another way around the problem!

Many thanks


Nathan

tabzter
09-13-2005, 07:06 PM
yes its possible to do this by using the <base> tag.

Position this tag between the <head> </head> tags in the following format


<head>
<base href="http://www.somedomain.com/directory/" target="_parent" />
</head>


where the href is the address of the page you want all URI's to be relative to and target (which is optional) defines how each link will behave, i.e. will it open in a new page (target="_blank"), parent page (see above), top page (target="_top") etc..