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 7 of 7
  1. #1
    New Coder
    Join Date
    Jul 2002
    Location
    Sweden
    Posts
    66
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Window.opener question

    Is it possible to use window.opener in frames...

    ////////////

    main.htm ->

    window.open('page.htm','page');

    function al()
    {
    alert('hello');
    }

    ////////////

    page.htm ->

    <frameset cols="40,*">
    <frame src="left.htm">
    <frame src="right.htm">
    </frameset>

    ////////////

    right.htm ->

    window.opener.al(); //this doesn't work... it's there so you get the picture...

    ////////////

    I was thinking if something like window.opener.opener.al() possible could work...

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    United Kingdom Confused: Often
    Posts
    859
    Thanks
    0
    Thanked 0 Times in 0 Posts
    remember its window.open not window.opener...

    window.open can be used in frames but im not sure if it can be accessed by the page in the frame
    redhead

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    FL, USA
    Posts
    734
    Thanks
    0
    Thanked 0 Times in 0 Posts
    why don't you try somthing like this

    window.opener.parent.left.location.href="bla.html"

    i just used a location b/c i didn't know what your trying to do with the frame
    CYWebmaster.com - See why we dot com!!
    ACJavascripts.com - Cut & Paste Javascripts!
    SimplyProgram.com - Personal Blog

  • #4
    New Coder
    Join Date
    Jul 2002
    Location
    Sweden
    Posts
    66
    Thanks
    1
    Thanked 0 Times in 0 Posts
    By ACJavascript: just used a location b/c i didn't know what your trying to do with the frame
    It's the function ai() in main.htm that I'm trying to reach from right.htm, (thought that was fairly obvious...)

    I can't use just window.opener because the page is in a frame.
    If it had been just one new window it would have worked as I wrote in my first message...

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Location
    FL, USA
    Posts
    734
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i don't think its possible to call a function in a different frame, or as window.opener. I could be wrong but i don't think so.
    CYWebmaster.com - See why we dot com!!
    ACJavascripts.com - Cut & Paste Javascripts!
    SimplyProgram.com - Personal Blog

  • #6
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,273
    Thanks
    4
    Thanked 83 Times in 82 Posts
    You can't use opener in right.htm because right.htm was not opened by main.html. Page.htm was the page opened by main.htm so......

    how about

    top.opener.al()
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #7
    New Coder
    Join Date
    Jul 2002
    Location
    Sweden
    Posts
    66
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Hell, why didn't I think of that... top.opener.al()....

    So obvious, thank you Spookster!


  •  

    Posting Permissions

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