|this code||produces this|
Change the URL in the last line to the URL of the frameset page. For example, if you want people to go to
myhomepage.html then set the last line like this:
This script checks to see if the current page is the "top" page (
if (top == self)). If it is, it writes out a notice to the user that they would probably rather be at another page, and writes out a link to that page.
You might notice a small disparity between this method and the Don't Get Framed method. In this example the user is presented with a passive link if they are not on the intended web page. In the previous example, however, no permission is asked: the browser is automatically forwarded to the intended page. The reason for this difference lies in the slight difference in intentions between the two pages. The "Don't Frame Me" script is intended to act as a deterrence, to stop somebody else from framing the page. The best deterrence in this case is to unload their page without further ado. The "Do Frame Me" script, however, is not intended to act as a deterrence, only as a gentle reminder, so a gentler method of redirection is used.Copyright 1997-2002 Idocs Inc. Content in this guide is offered freely to the public under the terms of the Open Content License and the Open Publication License. Contents may be redistributed or republished freely under these terms so long as credit to the original creator and contributors is maintained.