How to detect if your site or current page has been opened in a frame (such as Google images) ?

The following cool code is supposed to redirect if your site has been opened in a frame.

<script type="text/javascript" language="JavaScript">
var topLocation
try {topLocation = top.location.href; }
catch(er) { window.top.location.href = self.location.href;}
</script>

Credits: http://www.mydreamsbook.com

How did I find this ?

I was looking for Elizabeth Banks pictures :D (She's so beautiful by the way).
She is in Zack and Miri Make a Porno film which by the way I didn't like so much but that's another topic.
Related

Tags: , , ,

One Response to “How to detect if your site or current page has been opened in a frame (such as Google images) ?”

  1. AlexAxe Says:

    Hi there,
    slavi.biz - da best. Keep it going!

    Thank you
    AlexAxe

Leave a Reply