PDA

View Full Version : inline frames (iframes) glue together



killahert
March 14th, 2007, 05:43 PM
does anyone know java script on how to 'glue' iframes in case if google found iframe without the main page? I can glue frames but not sure how to 'glue' iframes.

kBisk
March 15th, 2007, 09:27 AM
you'd have to put a script on each of the pages that would be in the iframe. Along the lines of

if(top.location == self.location){ //the iframe is on its own
top.location.href = "iframeParentPage.htm"; //redirect to the page that holds the iframe
}

killahert
March 15th, 2007, 02:45 PM
hey there I tried putting that script but for some reason it feels like something is missing. Just to be sure where do I put that code before, after 'head'.. is this AS script?

kBisk
March 15th, 2007, 03:51 PM
Its javascript - you'll have to put this in the head of the document:


<head>
<title></title><more tags ..... />

<script type="text/javascript">
if(top.location == self.location){
top.location.href = "iframeParentPage.htm";
}
</script>

</head>

killahert
March 15th, 2007, 06:36 PM
:D

thank you kBisk