... Don t get framed ...



• 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:

<!–
if (top != self)
top.location=self.document.location;
//–>

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

 Bookmark with:            
Source: web-design-ireland | pub: 15 Oct 2007 by: Louie Eire Web Design | added: 26 Feb 2008 | cat: Javascript | views: 60 time/s
Leave a Comment...
Name: *
Email: *
Comment: *
Security Code: security code
*
     Remember me:
Categories
Channels
Press Release