Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jun 2002
    Location
    Canada
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Targeting frames in a new window w/ document.write

    Hullo,

    If I'm using a script with the following line:

    document.write ................ etc.

    How do I tell it to target a specific frame within a new frameset within a new pop-up window.

    In other words .................

    Let's say I have a link:

    <a href="home.htm" target="_new">home</a>

    This link will open a new window w/ home.htm in it. Now what if home.htm was a frameset w/ 2 frames, "left" and "right".

    How would I go about having that link write to a specific frame, (ie. like the "left" frame,) within that pop up window?

    For example: the link uses document.write to write "Hello World." You click the link, it opens a new window containing a frame set w/ 2 frames, and the "left" frame says in it "Hello World."



    What I've gathered thus far: if that link is within a frame in a frame set, and is to target another frame in the same frame set, the script is as follows:

    parent.FRAME.document.write......................... etc.

    where FRAME is the name of the frame.

    Any help guys?
    Tombo out.

  • #2
    Regular Coder
    Join Date
    Sep 2002
    Location
    Louisiana
    Posts
    576
    Thanks
    0
    Thanked 0 Times in 0 Posts
    give the new window a name, like this
    window.open("./home.html", "name", "options");
    name.parent.frames[frame#].document.write();


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •