[thelist] Avoiding "Orphan" Frames

Bob Davis bobd at members.evolt.org
Wed Feb 28 13:13:23 CST 2001


on 2/28/01 1:58 PM, gregory.john.toland at census.gov at
gregory.john.toland at census.gov wrote:

> What is the best way to avoid the "orphan" frame syndrome?  I don't want
> users to go directly to a frame.  If they do then it loads the parent
> frameset.

Well, to echo John, though in a slightly modified light, don't use frames
unless they are the only way to do the job right (which is a call you have
to make).

That being said, you can do it in JavaScript.  I've seen Perl scripts that
do it as well.

I found this one quickly -

http://www.digitalroom.net/index2.html

<SCRIPT LANGUAGE="JavaScript">
<!--
  if (top.frames.length == 0) {
    document.cookie = "newURL=" + escape(document.URL) + "; path=/;"
    ver = parseInt(navigator.appVersion, 10);
    if ( ((navigator.appName == "Netscape") && (ver >= 3)) ||
         ((navigator.appName == "Microsoft Internet Explorer") && (ver >=
4)) )
      location.replace("/index2.html");
    else
      location = "/index2.html";
    };
//-->
</SCRIPT>


If you go here, you can see it work:

http://www.digitalroom.net/javascript/frame.html

bob

-- 

bob davis
bobd at members.evolt.org





More information about the thelist mailing list