[thelist] https site in a frame of an http site

.jeff jeff at members.evolt.org
Thu Oct 11 18:53:19 CDT 2001


kristy,

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: Kristy Frey
>
> Thanks Kevin - BTW,  I stuck this in my page:
>
> <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
> <!--
> function GetOutOfFrame()
> {
>   if (top.location != location)
> 	{
>     top.location.href = document.location.href ;
>   }
> }
> //-->
> </SCRIPT>
>
> and put onload="GetOutOfFrame()" in the body tag.
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

this is likely to cause an error for some users.  if the domain of the top
level frames page is different than yours, browser security will keep you
from reading it to compare the two, throwing a javascript security error for
the user instead.  additionally, it would be better to set it up to fire as
soon as the page begins to load to keep people from having to wait until
it's loaded only to have it reload and bust out of frames.  try this simple
bit on for size:

<script language="JavaScript" type="text/javascript">
<!--
  if(self != top)
    top.location.href = self.location.href;
// -->
</script>

good luck,

.jeff

http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/






More information about the thelist mailing list