Forum Moderators: coopster

Message Too Old, No Replies

My app breaks in Hotmail Frame

any way to get rid of it?

         

shasan

8:41 pm on Sep 21, 2003 (gmt 0)

10+ Year Member



Hi Guys,

I have a message board app that konks out if someone comes to the site through hotmail. It's because of that ridiculous hotmail frame.

Is there any way of making sure that my site doesn't appear in a framed page?

Cheers.
shasan.

Macro

8:54 pm on Sep 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I use a js in my header.

There are several free ones like


<script language=javascript>
<!--//
var wind,doc;
wind = parent.location;
doc = document.location;
if (wind!= doc) {
parent.location.href= doc;
}
//-->
</script>

(please check for copyright)

MonkeeSage

9:02 pm on Sep 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Not sure in PHP, but with JavaScript you can do something like:

if ((parent) && (parent.frames.length > 0)) {
parent.location.href = self.location.href;
}

If you can check for frames in PHP, you could probably do something similar.

Jordan

[Edit:] Macro beat me... [/edit]

shasan

9:11 pm on Sep 21, 2003 (gmt 0)

10+ Year Member



thanks, JS is fine, it's actually better for me. I'll give that a shot.

shasan

6:01 pm on Sep 22, 2003 (gmt 0)

10+ Year Member



Cool, it worked. I added the code it to my .js file and it works like a charm.

cheers
shasan