TechWhirl (TECHWR-L) is a resource for technical writing and technical communications professionals of all experience levels and in all industries to share their experiences and acquire information.
For two decades, technical communicators have turned to TechWhirl to ask and answer questions about the always-changing world of technical communications, such as tools, skills, career paths, methodologies, and emerging industries. The TechWhirl Archives and magazine, created for, by and about technical writers, offer a wealth of knowledge to everyone with an interest in any aspect of technical communications.
At 03:27 PM 4/9/98 -0500, Barb Ostapina wrote:
>Eric, what does adding this script do?
>--B
><SCRIPT>
><!--
>top.location.target="_top"
>if (window.location.target != "_top")
>{
>top.location.href=window.location.href
>}
>//-->
></SCRIPT>
This one checks to see if the current document (the one the
script is in) is in a frame (which is the same as NOT being
at the top of the window). If the page is at the top, the
script does nothing. If the page isn't at the top, the script
resets the current window location to BE at the top of the window
(thus not in a frame).
>If you're using frames in your own document, you'd want to
>modify the code to check what the frame name is and
>break out only if needed. For example, if your frameset names the
>content frame "body", use this:
>
><SCRIPT>
><!--
>top.location.target="_top"
>if ((window.frames.name != "body") && (window.location.target != "_top"))
>{
>top.location.href=window.location.href
>}
>//-->
></SCRIPT>
This does the same as the first, but checks the frame name and
doesn't break out of a "body" frame, but does break out of
all others. This way you can protect your own stuff while still
using a framed layout.
Does this help?
Eric
*********************************************************
* Eric J. Ray, ejray -at- raycomm -dot- com, http://www.raycomm.com/
* TECHWR-L Listowner, co-author _Mastering HTML 4.0_
* _HTML 4 for Dummies Quick Reference_, and others.
* RayComm, Inc., currently accepting contract inquiries.