frames issue

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kyle

    frames issue

    I'm sure this question has been asked many times, but I cannot find an
    answer that will help me do what I need to do.

    I have a site with 2 frames -- 'top' and 'main'. 'top' is a navigation
    / menu bar and 'main' is the content (parent).I'm looking for some
    clientside code that will change the URL of the 'top' frame when a
    specific URL is loaded into the 'main' frame.

    For instance when "stuff.htm" is displayed in 'main', I want
    "stuffnav.h tm" to be displayed in 'top'. When "otherstuff.htm " is
    displayed in 'main', I'd like "otherstuffnav. htm' to be displayed in
    'top'

    Make sense? If anyone has some code samples to share or ideas, I'd
    appreciate it.

    TIA for all your help.

    -- Kyle
  • kaeli

    #2
    Re: frames issue

    In article <8aa36d32.04042 70503.1c0347cb@ posting.google. com>, kbweb02
    @yahoo.com enlightened us with...[color=blue]
    >
    > I have a site with 2 frames -- 'top' and 'main'. 'top' is a navigation
    > / menu bar and 'main' is the content (parent).I'm looking for some
    > clientside code that will change the URL of the 'top' frame when a
    > specific URL is loaded into the 'main' frame.
    >[/color]

    I assume the frameset names the frames "top" and "main".
    Also, the content (main) is not a parent.
    [color=blue]
    > For instance when "stuff.htm" is displayed in 'main', I want
    > "stuffnav.h tm" to be displayed in 'top'. When "otherstuff.htm " is
    > displayed in 'main', I'd like "otherstuffnav. htm' to be displayed in
    > 'top'
    >[/color]

    Note: the following will not function at all if people don't have script
    enabled. This is a Bad Thing for internet sites.

    Anyway, you asked...

    In the onload of stuff.htm

    <body onLoad="top.fra mes['top'].location='stuf fnav.htm'">


    --
    --
    ~kaeli~
    Why do they sterilize the needles for lethal injections?



    Comment

    • Thomas 'PointedEars' Lahn

      #3
      Re: frames issue

      kaeli wrote:
      [color=blue]
      > In article <8aa36d32.04042 70503.1c0347cb@ posting.google. com>, kbweb02
      > @yahoo.com enlightened us with...[/color]

      Please do not write attribution novels:
      <http://netmeister.org/news/learn2quote1.ht ml>
      [color=blue][color=green]
      >> For instance when "stuff.htm" is displayed in 'main', I want
      >> "stuffnav.h tm" to be displayed in 'top'. When "otherstuff.htm " is
      >> displayed in 'main', I'd like "otherstuffnav. htm' to be displayed in
      >> 'top'[/color]
      >
      > Note: the following will not function at all if people don't have script
      > enabled. [...][/color]

      More, it will not work if the document is not displayed within a frameset.
      [color=blue]
      > [...]
      > In the onload of stuff.htm
      >
      > <body onLoad="top.fra mes['top'].location='stuf fnav.htm'">[/color]

      Since it is possible that the document is not displayed within a frameset,
      and "top" and related properties are proprietary, the following is better:

      function loadFrame(sName , sURI)
      {
      var f = null;
      if (typeof top != "undefined"
      && typeof top.frames != "undefined"
      && typeof top.frames[sName] != "undefined" )
      && (f = top.frames[sName])
      && typeof f.location != "undefined" )
      {
      f.location = sURI;
      }
      }

      <body onload="loadFra me('top', 'stuffnav.htm') ">

      This will of course not work without client-side script support either.


      PointedEars

      Comment

      Working...