Re: IFRAME link reference to containing page

by Norman Bunn <norman.bunn(at)craftedsolutions.com>

 Date:  Mon, 14 Apr 2003 11:57:15 -0400
 To:  "Peter-Paul Koch" <gassinaumasis(at)hotmail.com>,
hwg-techniques(at)hwg.org
 In-Reply-To:  hotmail
  todo: View Thread, Original
At 11:07 AM 4/14/2003, Peter-Paul Koch wrote:


>>How do I get a link in an IFRAME to reference the containing page?
>>Example: www.whitakerfuneralhome.com service schedule has a link to the 
>>on-line obits that I want to replace the containing page when clicked 
>>instead of creating a new page.
>
>Through JavaScript it's a simple parent.location.href .  But I don't know 
>how to do this with the target attribute. I vaguely seem to remember 
>target="_parent", you might try it and see what happens.

Thanks!  This seems to work.

<SCRIPT LANGUAGE = "JavaScript">
function toObits()
{
parent.location.href="http://www.whitakerfuneralhome.com/obit.shtml"
}
</script>
<a href="http://www.whitakerfuneralhome.com/obit.shtml" target="_parent" 
onClick="toObits()">See On-Line Obituary Listing for more details</a>

Norman

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA