Using a simple script to keep your site OUT of frames!

Have you ever had your site listed at about.com or other mega listing sites that stick your site helplessly into frames? Surfers can't get out of those frames which means that unless they are web savvy enough to figure out how to get it out of the frames then they can't bookmark your site, can't get to your sponsors as easily and can't make YOU money!

Here's a simple script that will keep those frames away for good!

Between your HEAD tags place this bit of code:


 

 

 

This isolates your page by

1 - Checking to see if the location of the current page (the self) is the highest in the hierarchy of the browser window. This is a simple check that is done so it won't affect your page when it is NOT being placed in frames.

2 - If it finds that your page is NOT at the highest point in the browser window hierarchy (meaning that it is stuck in frames) then it forces the current window to be your page and NOT the page that is framing your page. It's sort of like a "get out of jail free" card to break your way out of those pesky frames!

Home