Keeping a Page out of a FrameOther people can put one of your pages inside a frame on their site, making it appear that your page is part of their content. In JavaScript, windows appear in a hierarchy, with the parent window at the top of the heap. When someone hijacks your page, they are forcing it to be a child frame to their parent window. Figure 5.2 shows how the page would appear as part of someone else's site. With these scripts, you can prevent this page hijacking and force your page to always be in a browser window by itself. There are two scripts; Script 5.1 is the HTML page that should always stand alone and has the <script> tag that calls the JavaScript; Script 5.2 is the JavaScript document, which we'll describe next. Figure 5.2. Our page, buried in someone else's frameset.Script 5.1. Here is an HTML page that people want to hijack.
Script 5.2. JavaScript provides a way to force our page to always appear on a separate page.
Tip
|