Don’t get framed
Recently I came across a website that was displaying one of my pages in their own frame set which made it difficult to store the shopping cart session and was breaking the website functionality as well.
The solution was a small piece of Javascript added between the HEAD tags to remove all frames:
This script checks to see if the current page is the “top” page. If it is not, it tells the web browser to load the current web page as the top, thus wiping out any frames. Of course, this script won’t work with browsers that don’t understand scripting, or where scripting is turned off, but the script will work on most browsers, and that makes it a pretty effective deterrent
This entry was posted
on Monday, October 15th, 2007 at 11:12 am and is filed under JavaScript.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.















