frameset within frameset

Discussion in 'Javascript' started by Simon, Mar 19, 2007.

  1. Simon

    Simon Guest

    Hello,
    I have a problem.
    I have to frames, one at the bottom for navigation and the rest of the
    screen is the second frame.(output)
    There is a script that puts the focus on the outputframe in order to print
    only the contens of that frame.
    But now i have a page that contains two frames also, in the outputframe.
    How can i set focus to the second frame within the outputframe?
    Is there a way to specify a frame within a frame?

    (In short: two frames, one frame contains navigation, second frame contains
    output from navigationmenu, and, in this case, builds two new frames in the
    outputframe)

    Thanks,
    Simon
     
    Simon, Mar 19, 2007
    #1
    1. Advertisements

  2. Simon

    Tom Cole Guest

    Have you tried
    parent.frames['outputframe'].frames['frame_to_get_focus'].focus() or
    parent.outputframe.frame_to_get_focus.focus()?

    I'm not 100% clear on which is the preferred or most compliant method
    (the dot notation or array style access)...
     
    Tom Cole, Mar 19, 2007
    #2
    1. Advertisements

  3. Simon

    Simon Guest


    Simon:
    I've tried it, but it doesn't seem to work.
    Sorry..
     
    Simon, Mar 20, 2007
    #3
  4. Simon

    Tom Cole Guest

    Amazing, worked perfectly on my test page. Do you need me to upload it
    to the web for you, maybe it will give you some help?
     
    Tom Cole, Mar 20, 2007
    #4
  5. Tom Cole wrote:
    Referencing the window objects of named frame (and IFRAME) elements as
    named properties of the containing window object's - frames - collection
    is the most cross-browser (and so usually 'preferred') strategy.
    No distinction between dot notation property accessors and bracket
    notation property accessors has significance here. The two are
    equivalent in what they do. All dot notation property accessors could be
    re-written as bracket notation property accessors and produce precisely
    the same results. The reverse is only not true because the dot notation
    property accessor requires that the tokens on each side of the dot be
    Identifiers, while the bracket notation places no restrictions on the
    character sequence strings used inside the brackets (so the former can
    only access a limited set of property names, while the latter is
    unrestricted in the property names it can reference), and the
    expressions used between the brackets in a bracket notation property
    accessor are evaluated and type-converted into a string prior to their
    use as a property name (which is unnecessary with a dot notation
    property accessor), allowing the property name used to be unknown until
    runtime.

    parent.frames['outputframe'].frames['frame_to_get_focus'].focus()

    - and:-

    parent.frames.outputframe.frames.frame_to_get_focus.focus()

    - are equivilent.

    Richard.
     
    Richard Cornford, Mar 20, 2007
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.