How to prevent the display of Getting framed in HTML?

0

Getting framed refers to the document that is being displayed in someone else's frameset in your HTML. This will be password protected and the permissions has to be taken before inserting the frameset. The framing of the document can be avoided by using TARGET=_top applied to all the links that will lead to the document that are outside the scope of a particular user without permission. A javaScript can be used that will automatically handle the request to remove the existing framesets. This can be given as:

if (top.frames.length!=0)

{

if (window.location.href.replace)

top.location.replace(self.location.href);

else

top.location.href=self.document.href;

}

asked Apr 15, 2023 at 00:13
Sign in to add a comment

0 Answers

0
📝 No answers yet!

Be the first to answer this interview question.

Your Answer

Sign in to post your answer and help the community.