Web Analytics Made Easy -
StatCounter Window.opener question - CodingForum

Announcement

Collapse
No announcement yet.

Window.opener question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new 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
    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

    Comment


    • #3
      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

      Comment


      • #4
        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...

        Comment


        • #5
          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

          Comment


          • #6
            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
            CodingForum Supreme Overlord
            All Hail Spookster

            Comment


            • #7
              Hell, why didn't I think of that... top.opener.al()....

              So obvious, thank you Spookster!

              Comment

              Working...
              X