|
April 4, 2000 Escaping Frames Tips: April 2000
Yehuda Shiran, Ph.D.
|
|
When you create a Web page, you
expect the user to load it in the browser's main window, not in another site's
frame. By adding a simple cross-browser, cross-platform script into the HEAD
portion of your document, you can ensure that the page loads in the entire window.
Here's the script:
The condition evaluates to
Note that the following expressions would also function properly:
Back to the script. If the page's window isn't the topmost window in the object model, your page is being displayed as a frame in a frame-setting document. In order to escape the frames, you need to set the URL of the upper window to the URL of the current page:
Learn more about frames in Column 36, JavaScript and Frames, Part I .
People who read this tip also read these tips: Look for similar tips by subject: |