Is there a way to prevent getting framed?

Answer

"Getting framed" refers to having your documents displayed within someone else's frameset without your permission. This can happen accidentally (the frameset author forgot to use TARGET="_top" when linking to your document) or intentionally (the frameset author wanted to display your content with his/her own navigation or banner frames). To avoid "framing" other people's documents, you must add TARGET="_top" to all links that lead to documents outside your intended scope. Unfortunately, there is no reliable way to specify that a particular document should be displayed in the full browser window, rather than in the current frame. One workaround is to use <BASE TARGET="_top"> in the document, but this only specifies the default target frame for links in the current document, not for the document itself. If the reader's browser has JavaScript enabled, the following script will automatically remove any existing framesets: <script type="text/javascript">

if (top.frames.length!=0) { if (window.location.href.replace) top.location.replace(self.location.href); else top.location.href=self.document.href; } </script> An alternative script is <script type="text/javascript"> function breakOut() { if (self != top) window.open("my URL","_top",""); } </script> </HEAD> <BODY onLoad="breakOut()">

All html Questions

Ask your interview questions on html

Write Your comment or Questions if you want the answers on html from html Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---