Re: Copyright Infringement and Frames [OFF, possibly]

Subject: Re: Copyright Infringement and Frames [OFF, possibly]
From: "Eric J. Ray" <ejray -at- RAYCOMM -dot- COM>
Date: Fri, 10 Apr 1998 06:39:06 -0600

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.




Previous by Author: Re: Copyright Infringement and Frames [OFF, possibly]
Next by Author: ADMIN: Posting Rules Reminder (was Re: Does anyone need this book on the C programming language?)
Previous by Thread: Re: Copyright Infringement and Frames [OFF, possibly]
Next by Thread: Re[2]: Copyright Infringement and Frames [OFF, possibly]


What this post helpful? Share it with friends and colleagues:


Sponsored Ads