window.opener.location.reload()

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

    window.opener.location.reload()

    I have a page that opens a popup window and within the window, some databse
    info is submitted and the window closes. It then refreshes the original
    window using window.opener.l ocation.reload( ). The problem is that after the
    reload, it brings you right to the top of the page. When I click 'refresh"
    on the original page, it brings me back to the original viewing position.
    Is there a way to duplicate this in from the popup window.

    Also, is there a way to run window.opener.l ocation.reload( ) when the popup
    window is closed using the X in the upper right hand corner? Thanks!

    Darren


  • J Wynia

    #2
    Re: window.opener.l ocation.reload( )

    I haven't tried it between windows, but theoretically, you could capture
    the document.body.s crollLeft and document.body.s crollTop (the one you
    really need) values from the main window, reload and force those values
    back to what they were before the reload.

    So:

    $pageoffset = document.body.s crollTop;
    window.opener.l ocation.reload( );
    window.opener.d ocument.body.sc rollTop = $pageoffset;

    For your second question, technically the window.onunload event should
    give you the event handle you need. However, browser implementations and
    aggressive settings to avoid popunders have rendered this event much
    less reliable than it might have been in a utopian world where JS wasn't
    abused for intrusive advertising.

    -------------------------------------
    J Wynia
    Myriad Intellect, Inc.
    "Web technology that earns its keep."

    -------------------------------------

    Darren wrote:[color=blue]
    > I have a page that opens a popup window and within the window, some databse
    > info is submitted and the window closes. It then refreshes the original
    > window using window.opener.l ocation.reload( ). The problem is that after the
    > reload, it brings you right to the top of the page. When I click 'refresh"
    > on the original page, it brings me back to the original viewing position.
    > Is there a way to duplicate this in from the popup window.
    >
    > Also, is there a way to run window.opener.l ocation.reload( ) when the popup
    > window is closed using the X in the upper right hand corner? Thanks!
    >
    > Darren
    >
    >[/color]

    Comment

    • Darren

      #3
      Re: window.opener.l ocation.reload( )

      Thanks for the reply. Unfortunately I am fairley new to javascript. Could
      you expand on your answer a little. Where exactly would I put this code?
      Thanks!


      "J Wynia" <jwynia@speakea sy.net> wrote in message
      news:BLidnbx4uO 2Mce3fRVn-2w@speakeasy.ne t...[color=blue]
      >I haven't tried it between windows, but theoretically, you could capture
      >the document.body.s crollLeft and document.body.s crollTop (the one you
      >really need) values from the main window, reload and force those values
      >back to what they were before the reload.
      >
      > So:
      >
      > $pageoffset = document.body.s crollTop;
      > window.opener.l ocation.reload( );
      > window.opener.d ocument.body.sc rollTop = $pageoffset;
      >
      > For your second question, technically the window.onunload event should
      > give you the event handle you need. However, browser implementations and
      > aggressive settings to avoid popunders have rendered this event much less
      > reliable than it might have been in a utopian world where JS wasn't abused
      > for intrusive advertising.
      >
      > -------------------------------------
      > J Wynia
      > Myriad Intellect, Inc.
      > "Web technology that earns its keep."
      > www.myriadintellect.com
      > -------------------------------------
      >
      > Darren wrote:[color=green]
      >> I have a page that opens a popup window and within the window, some
      >> databse info is submitted and the window closes. It then refreshes the
      >> original window using window.opener.l ocation.reload( ). The problem is
      >> that after the reload, it brings you right to the top of the page. When
      >> I click 'refresh" on the original page, it brings me back to the original
      >> viewing position. Is there a way to duplicate this in from the popup
      >> window.
      >>
      >> Also, is there a way to run window.opener.l ocation.reload( ) when the
      >> popup window is closed using the X in the upper right hand corner?
      >> Thanks!
      >>
      >> Darren[/color][/color]


      Comment

      • J Wynia

        #4
        Re: window.opener.l ocation.reload( )

        First, put the code for your whole "close this window" process, which
        will give you something like this:

        function close_this_wind ow(){
        $pageoffset = document.body.s crollTop;
        window.opener.l ocation.reload( );
        window.opener.d ocument.body.sc rollTop = $pageoffset;
        window.close();
        }

        That function goes inside a script tag in your <head> tags.

        Then, on your <body> tag, you'll attach your function to the "onunload"
        event as well as to the "onclick" event of a button. For the body
        instance of it, the last line of the function is useless, but lets you
        use the same function for manual closing as well as accidental or
        toolbar closing.

        <body onunload="close _this_window(); ">

        <button onclick="close_ this_window();" >Close Window</button>

        This is all untested, so it may not work perfectly.

        -------------------------------------
        J Wynia
        Myriad Intellect, Inc.
        "Web technology that earns its keep."

        -------------------------------------

        Darren wrote:[color=blue]
        > Thanks for the reply. Unfortunately I am fairley new to javascript. Could
        > you expand on your answer a little. Where exactly would I put this code?
        > Thanks!
        >
        >
        > "J Wynia" <jwynia@speakea sy.net> wrote in message
        > news:BLidnbx4uO 2Mce3fRVn-2w@speakeasy.ne t...
        >[color=green]
        >>I haven't tried it between windows, but theoretically, you could capture
        >>the document.body.s crollLeft and document.body.s crollTop (the one you
        >>really need) values from the main window, reload and force those values
        >>back to what they were before the reload.
        >>
        >>So:
        >>
        >>$pageoffset = document.body.s crollTop;
        >>window.opener .location.reloa d();
        >>window.opener .document.body. scrollTop = $pageoffset;
        >>
        >>For your second question, technically the window.onunload event should
        >>give you the event handle you need. However, browser implementations and
        >>aggressive settings to avoid popunders have rendered this event much less
        >>reliable than it might have been in a utopian world where JS wasn't abused
        >>for intrusive advertising.
        >>
        >>-------------------------------------
        >>J Wynia
        >>Myriad Intellect, Inc.
        >>"Web technology that earns its keep."
        >>www.myriadintellect.com
        >>-------------------------------------
        >>
        >>Darren wrote:
        >>[color=darkred]
        >>>I have a page that opens a popup window and within the window, some
        >>>databse info is submitted and the window closes. It then refreshes the
        >>>original window using window.opener.l ocation.reload( ). The problem is
        >>>that after the reload, it brings you right to the top of the page. When
        >>>I click 'refresh" on the original page, it brings me back to the original
        >>>viewing position. Is there a way to duplicate this in from the popup
        >>>window.
        >>>
        >>>Also, is there a way to run window.opener.l ocation.reload( ) when the
        >>>popup window is closed using the X in the upper right hand corner?
        >>>Thanks!
        >>>
        >>>Darren[/color][/color]
        >
        >
        >[/color]

        Comment

        • Darren

          #5
          Re: window.opener.l ocation.reload( )

          I put all this code in the popup window. Everything works except for the
          scroll position. Do I need to pass the scroll position from the parent
          window to the popup somehow?

          "J Wynia" <jwynia@speakea sy.net> wrote in message
          news:wsWdnbtlVq GLhOzfRVn-gg@speakeasy.ne t...[color=blue]
          > First, put the code for your whole "close this window" process, which will
          > give you something like this:
          >
          > function close_this_wind ow(){
          > $pageoffset = document.body.s crollTop;
          > window.opener.l ocation.reload( );
          > window.opener.d ocument.body.sc rollTop = $pageoffset;
          > window.close();
          > }
          >
          > That function goes inside a script tag in your <head> tags.
          >
          > Then, on your <body> tag, you'll attach your function to the "onunload"
          > event as well as to the "onclick" event of a button. For the body instance
          > of it, the last line of the function is useless, but lets you use the same
          > function for manual closing as well as accidental or toolbar closing.
          >
          > <body onunload="close _this_window(); ">
          >
          > <button onclick="close_ this_window();" >Close Window</button>
          >
          > This is all untested, so it may not work perfectly.
          >
          > -------------------------------------
          > J Wynia
          > Myriad Intellect, Inc.
          > "Web technology that earns its keep."
          > www.myriadintellect.com
          > -------------------------------------
          >
          > Darren wrote:[color=green]
          >> Thanks for the reply. Unfortunately I am fairley new to javascript.
          >> Could you expand on your answer a little. Where exactly would I put this
          >> code? Thanks!
          >>
          >>
          >> "J Wynia" <jwynia@speakea sy.net> wrote in message
          >> news:BLidnbx4uO 2Mce3fRVn-2w@speakeasy.ne t...
          >>[color=darkred]
          >>>I haven't tried it between windows, but theoretically, you could capture
          >>>the document.body.s crollLeft and document.body.s crollTop (the one you
          >>>really need) values from the main window, reload and force those values
          >>>back to what they were before the reload.
          >>>
          >>>So:
          >>>
          >>>$pageoffse t = document.body.s crollTop;
          >>>window.opene r.location.relo ad();
          >>>window.opene r.document.body .scrollTop = $pageoffset;
          >>>
          >>>For your second question, technically the window.onunload event should
          >>>give you the event handle you need. However, browser implementations and
          >>>aggressive settings to avoid popunders have rendered this event much less
          >>>reliable than it might have been in a utopian world where JS wasn't
          >>>abused for intrusive advertising.
          >>>
          >>>-------------------------------------
          >>>J Wynia
          >>>Myriad Intellect, Inc.
          >>>"Web technology that earns its keep."
          >>>www.myriadintellect.com
          >>>-------------------------------------
          >>>
          >>>Darren wrote:
          >>>
          >>>>I have a page that opens a popup window and within the window, some
          >>>>databse info is submitted and the window closes. It then refreshes the
          >>>>original window using window.opener.l ocation.reload( ). The problem is
          >>>>that after the reload, it brings you right to the top of the page. When
          >>>>I click 'refresh" on the original page, it brings me back to the
          >>>>original viewing position. Is there a way to duplicate this in from the
          >>>>popup window.
          >>>>
          >>>>Also, is there a way to run window.opener.l ocation.reload( ) when the
          >>>>popup window is closed using the X in the upper right hand corner?
          >>>>Thanks!
          >>>>
          >>>>Darren[/color]
          >>
          >>[/color][/color]

          Comment

          • J Wynia

            #6
            Re: window.opener.l ocation.reload( )

            Since you said you're learning, I'll try to explain rather than just
            give you the fix. If it still doesn't make sense, reply and I'll give
            you the fixed line.

            There was a bug in the function. If you look at the first line inside
            the function, and compare the DOM address (the document.body.. . part) to
            the DOM address in the 3rd line, you should see the problem.

            The 3rd line is setting the opener document's scroll location. However,
            the first one isn't getting the scroll location from the opener
            document's scroll location. Rather it's getting it from the current
            document, which in this case, is the popup.

            So, nothing needs to be passed per-se. It's just that the popup is
            fetching the scroll location from the wrong place (mostly because I
            wasn't thinking about the 2 window portion when I typed up the line to
            get the scrolling info.

            Darren wrote:[color=blue]
            > I put all this code in the popup window. Everything works except for the
            > scroll position. Do I need to pass the scroll position from the parent
            > window to the popup somehow?
            >
            > "J Wynia" <jwynia@speakea sy.net> wrote in message
            > news:wsWdnbtlVq GLhOzfRVn-gg@speakeasy.ne t...
            >[color=green]
            >>First, put the code for your whole "close this window" process, which will
            >>give you something like this:
            >>
            >>function close_this_wind ow(){
            >>$pageoffset = document.body.s crollTop;
            >>window.opener .location.reloa d();
            >>window.opener .document.body. scrollTop = $pageoffset;
            >>window.close( );
            >>}
            >>
            >>That function goes inside a script tag in your <head> tags.
            >>
            >>Then, on your <body> tag, you'll attach your function to the "onunload"
            >>event as well as to the "onclick" event of a button. For the body instance
            >>of it, the last line of the function is useless, but lets you use the same
            >>function for manual closing as well as accidental or toolbar closing.
            >>
            >><body onunload="close _this_window(); ">
            >>
            >><button onclick="close_ this_window();" >Close Window</button>
            >>
            >>This is all untested, so it may not work perfectly.
            >>
            >>-------------------------------------
            >>J Wynia
            >>Myriad Intellect, Inc.
            >>"Web technology that earns its keep."
            >>www.myriadintellect.com
            >>-------------------------------------
            >>
            >>Darren wrote:
            >>[color=darkred]
            >>>Thanks for the reply. Unfortunately I am fairley new to javascript.
            >>>Could you expand on your answer a little. Where exactly would I put this
            >>>code? Thanks!
            >>>
            >>>
            >>>"J Wynia" <jwynia@speakea sy.net> wrote in message
            >>>news:BLidnbx 4uO2Mce3fRVn-2w@speakeasy.ne t...
            >>>
            >>>
            >>>>I haven't tried it between windows, but theoretically, you could capture
            >>>>the document.body.s crollLeft and document.body.s crollTop (the one you
            >>>>really need) values from the main window, reload and force those values
            >>>>back to what they were before the reload.
            >>>>
            >>>>So:
            >>>>
            >>>>$pageoffs et = document.body.s crollTop;
            >>>>window.open er.location.rel oad();
            >>>>window.open er.document.bod y.scrollTop = $pageoffset;
            >>>>
            >>>>For your second question, technically the window.onunload event should
            >>>>give you the event handle you need. However, browser implementations and
            >>>>aggressiv e settings to avoid popunders have rendered this event much less
            >>>>reliable than it might have been in a utopian world where JS wasn't
            >>>>abused for intrusive advertising.
            >>>>
            >>>>-------------------------------------
            >>>>J Wynia
            >>>>Myriad Intellect, Inc.
            >>>>"Web technology that earns its keep."
            >>>>www.myriadintellect.com
            >>>>-------------------------------------
            >>>>
            >>>>Darren wrote:
            >>>>
            >>>>
            >>>>>I have a page that opens a popup window and within the window, some
            >>>>>databse info is submitted and the window closes. It then refreshes the
            >>>>>original window using window.opener.l ocation.reload( ). The problem is
            >>>>>that after the reload, it brings you right to the top of the page. When
            >>>>>I click 'refresh" on the original page, it brings me back to the
            >>>>>original viewing position. Is there a way to duplicate this in from the
            >>>>>popup window.
            >>>>>
            >>>>>Also, is there a way to run window.opener.l ocation.reload( ) when the
            >>>>>popup window is closed using the X in the upper right hand corner?
            >>>>>Thanks!
            >>>>>
            >>>>>Darren
            >>>
            >>>[/color][/color]
            >[/color]

            Comment

            • RobB

              #7
              Re: window.opener.l ocation.reload( )

              Darren wrote:[color=blue]
              > I have a page that opens a popup window and within the window, some[/color]
              databse[color=blue]
              > info is submitted and the window closes. It then refreshes the[/color]
              original[color=blue]
              > window using window.opener.l ocation.reload( ). The problem is that[/color]
              after the[color=blue]
              > reload, it brings you right to the top of the page. When I click[/color]
              'refresh"[color=blue]
              > on the original page, it brings me back to the original viewing[/color]
              position.[color=blue]
              > Is there a way to duplicate this in from the popup window.
              >
              > Also, is there a way to run window.opener.l ocation.reload( ) when the[/color]
              popup[color=blue]
              > window is closed using the X in the upper right hand corner? Thanks!
              >
              > Darren[/color]

              Here are three demo files that offer a possible solution.
              Testing is up to you.

              <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
              "http://www.w3.org/TR/html4/strict.dtd">
              <html>
              <head>
              <style type="text/css">

              body {
              font: 120% bold monospace;
              }

              </style>
              <script type="text/javascript">

              var subwin = null;
              function open_subwin()
              {
              subwin = window.open(
              'subwin.html',
              'subwin',
              'left=200,top=2 00,' +
              'width=240,heig ht=200,' +
              'status,scrollb ars,resizable'
              );
              if (subwin && !subwin.closed)
              subwin.focus();
              }

              function saveYpos()
              {
              var y_scroll =
              window.pageYOff set ?
              pageYOffset :
              document.docume ntElement
              && 'undefined' != typeof document.docume ntElement.scrol lTop ?
              document.docume ntElement.scrol lTop :
              document.body ?
              document.body.s crollTop :
              null;
              if (y_scroll)
              window.name = 'YSCROLL@' + y_scroll;
              window.location .reload(true);
              }

              window.onload = function(m)
              {
              if (m = window.name.mat ch(/YSCROLL@(\d+)/))
              window.scrollTo (0, m[1] || 0);
              window.name = '';
              }

              </script>
              </head>
              <body>
              <form style="padding: 1200px 0;">
              -1<br>-2<br>-3<br>-4<br>-5<br>-6<br>-7<br>-8<br>-9<br><br>
              <input
              type="button"
              value="add data"
              onclick="open_s ubwin()">
              </form>
              </body>
              </html>

              [subwin.html]

              <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
              "http://www.w3.org/TR/html4/strict.dtd">
              <html>
              <head>
              <style type="text/css">

              body {
              margin: 50px 10px;
              }

              </style>
              <script type="text/javascript">

              window.onunload = function()
              {
              if (opener
              && !opener.closed
              && opener.saveYpos )
              {
              opener.saveYpos ();
              }
              }

              </script>
              </head>
              <body>
              <form
              action="f_actio n.html"
              method="post"
              onsubmit="windo w.onunload=null ">
              <input
              type="text"
              name="newdata"
              value="new data">
              <input
              type="submit"
              value="done">
              </form>
              </body>
              </html>

              [f_action.html]

              <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
              "http://www.w3.org/TR/html4/strict.dtd">
              <html>
              <head>
              <script type="text/javascript">

              if (opener
              && !opener.closed
              && opener.saveYpos )
              {
              opener.saveYpos ();
              }
              self.close();

              </script>
              </head>
              <body>
              </body>
              </html>

              Comment

              • Darren

                #8
                Re: window.opener.l ocation.reload( )

                I changed the third line to window.opener.d ocument.body.sc rollTop =
                $pageoffset;

                and this still does not scroll back to the original position. Sorry for the
                trouble!

                Darren

                "J Wynia" <jwynia@speakea sy.net> wrote in message
                news:RfudnbQmca fmpu_fRVn-3Q@speakeasy.ne t...[color=blue]
                > Since you said you're learning, I'll try to explain rather than just give
                > you the fix. If it still doesn't make sense, reply and I'll give you the
                > fixed line.
                >
                > There was a bug in the function. If you look at the first line inside the
                > function, and compare the DOM address (the document.body.. . part) to the
                > DOM address in the 3rd line, you should see the problem.
                >
                > The 3rd line is setting the opener document's scroll location. However,
                > the first one isn't getting the scroll location from the opener document's
                > scroll location. Rather it's getting it from the current document, which
                > in this case, is the popup.
                >
                > So, nothing needs to be passed per-se. It's just that the popup is
                > fetching the scroll location from the wrong place (mostly because I wasn't
                > thinking about the 2 window portion when I typed up the line to get the
                > scrolling info.
                >
                > Darren wrote:[color=green]
                >> I put all this code in the popup window. Everything works except for the
                >> scroll position. Do I need to pass the scroll position from the parent
                >> window to the popup somehow?
                >>
                >> "J Wynia" <jwynia@speakea sy.net> wrote in message
                >> news:wsWdnbtlVq GLhOzfRVn-gg@speakeasy.ne t...
                >>[color=darkred]
                >>>First, put the code for your whole "close this window" process, which
                >>>will give you something like this:
                >>>
                >>>function close_this_wind ow(){
                >>>$pageoffse t = document.body.s crollTop;
                >>>window.opene r.location.relo ad();
                >>>window.opene r.document.body .scrollTop = $pageoffset;
                >>>window.close ();
                >>>}
                >>>
                >>>That function goes inside a script tag in your <head> tags.
                >>>
                >>>Then, on your <body> tag, you'll attach your function to the "onunload"
                >>>event as well as to the "onclick" event of a button. For the body
                >>>instance of it, the last line of the function is useless, but lets you
                >>>use the same function for manual closing as well as accidental or toolbar
                >>>closing.
                >>>
                >>><body onunload="close _this_window(); ">
                >>>
                >>><button onclick="close_ this_window();" >Close Window</button>
                >>>
                >>>This is all untested, so it may not work perfectly.
                >>>
                >>>-------------------------------------
                >>>J Wynia
                >>>Myriad Intellect, Inc.
                >>>"Web technology that earns its keep."
                >>>www.myriadintellect.com
                >>>-------------------------------------
                >>>
                >>>Darren wrote:
                >>>
                >>>>Thanks for the reply. Unfortunately I am fairley new to javascript.
                >>>>Could you expand on your answer a little. Where exactly would I put
                >>>>this code? Thanks!
                >>>>
                >>>>
                >>>>"J Wynia" <jwynia@speakea sy.net> wrote in message
                >>>>news:BLidnb x4uO2Mce3fRVn-2w@speakeasy.ne t...
                >>>>
                >>>>
                >>>>>I haven't tried it between windows, but theoretically, you could
                >>>>>capture the document.body.s crollLeft and document.body.s crollTop (the
                >>>>>one you really need) values from the main window, reload and force
                >>>>>those values back to what they were before the reload.
                >>>>>
                >>>>>So:
                >>>>>
                >>>>>$pageoffse t = document.body.s crollTop;
                >>>>>window.ope ner.location.re load();
                >>>>>window.ope ner.document.bo dy.scrollTop = $pageoffset;
                >>>>>
                >>>>>For your second question, technically the window.onunload event should
                >>>>>give you the event handle you need. However, browser implementations
                >>>>>and aggressive settings to avoid popunders have rendered this event
                >>>>>much less reliable than it might have been in a utopian world where JS
                >>>>>wasn't abused for intrusive advertising.
                >>>>>
                >>>>>-------------------------------------
                >>>>>J Wynia
                >>>>>Myriad Intellect, Inc.
                >>>>>"Web technology that earns its keep."
                >>>>>www.myriadintellect.com
                >>>>>-------------------------------------
                >>>>>
                >>>>>Darren wrote:
                >>>>>
                >>>>>
                >>>>>>I have a page that opens a popup window and within the window, some
                >>>>>>databse info is submitted and the window closes. It then refreshes
                >>>>>>the original window using window.opener.l ocation.reload( ). The
                >>>>>>problem is that after the reload, it brings you right to the top of
                >>>>>>the page. When I click 'refresh" on the original page, it brings me
                >>>>>>back to the original viewing position. Is there a way to duplicate
                >>>>>>this in from the popup window.
                >>>>>>
                >>>>>>Also, is there a way to run window.opener.l ocation.reload( ) when the
                >>>>>>popup window is closed using the X in the upper right hand corner?
                >>>>>>Thanks!
                >>>>>>
                >>>>>>Darren
                >>>>
                >>>>[/color]
                >>[/color][/color]


                Comment

                • J Wynia

                  #9
                  Re: window.opener.l ocation.reload( )

                  You need to change the 1st line, not the 3rd. In general, you're trying
                  to ask the original page just how far down it's currently scrolled,
                  saving that number, doing your other stuff, and, when you close your
                  popup window reload the original page and move it back to where it was.
                  So, you need to make sure it's fetching the original location before
                  anything else will work.

                  Darren wrote:[color=blue]
                  > I changed the third line to window.opener.d ocument.body.sc rollTop =
                  > $pageoffset;
                  >
                  > and this still does not scroll back to the original position. Sorry for the
                  > trouble!
                  >
                  > Darren
                  >
                  > "J Wynia" <jwynia@speakea sy.net> wrote in message
                  > news:RfudnbQmca fmpu_fRVn-3Q@speakeasy.ne t...
                  >[color=green]
                  >>Since you said you're learning, I'll try to explain rather than just give
                  >>you the fix. If it still doesn't make sense, reply and I'll give you the
                  >>fixed line.
                  >>
                  >>There was a bug in the function. If you look at the first line inside the
                  >>function, and compare the DOM address (the document.body.. . part) to the
                  >>DOM address in the 3rd line, you should see the problem.
                  >>
                  >>The 3rd line is setting the opener document's scroll location. However,
                  >>the first one isn't getting the scroll location from the opener document's
                  >>scroll location. Rather it's getting it from the current document, which
                  >>in this case, is the popup.
                  >>
                  >>So, nothing needs to be passed per-se. It's just that the popup is
                  >>fetching the scroll location from the wrong place (mostly because I wasn't
                  >>thinking about the 2 window portion when I typed up the line to get the
                  >>scrolling info.
                  >>
                  >>Darren wrote:
                  >>[color=darkred]
                  >>>I put all this code in the popup window. Everything works except for the
                  >>>scroll position. Do I need to pass the scroll position from the parent
                  >>>window to the popup somehow?
                  >>>
                  >>>"J Wynia" <jwynia@speakea sy.net> wrote in message
                  >>>news:wsWdnbt lVqGLhOzfRVn-gg@speakeasy.ne t...
                  >>>
                  >>>
                  >>>>First, put the code for your whole "close this window" process, which
                  >>>>will give you something like this:
                  >>>>
                  >>>>function close_this_wind ow(){
                  >>>>$pageoffs et = document.body.s crollTop;
                  >>>>window.open er.location.rel oad();
                  >>>>window.open er.document.bod y.scrollTop = $pageoffset;
                  >>>>window.clos e();
                  >>>>}
                  >>>>
                  >>>>That function goes inside a script tag in your <head> tags.
                  >>>>
                  >>>>Then, on your <body> tag, you'll attach your function to the "onunload"
                  >>>>event as well as to the "onclick" event of a button. For the body
                  >>>>instance of it, the last line of the function is useless, but lets you
                  >>>>use the same function for manual closing as well as accidental or toolbar
                  >>>>closing.
                  >>>>
                  >>>><body onunload="close _this_window(); ">
                  >>>>
                  >>>><button onclick="close_ this_window();" >Close Window</button>
                  >>>>
                  >>>>This is all untested, so it may not work perfectly.
                  >>>>
                  >>>>-------------------------------------
                  >>>>J Wynia
                  >>>>Myriad Intellect, Inc.
                  >>>>"Web technology that earns its keep."
                  >>>>www.myriadintellect.com
                  >>>>-------------------------------------
                  >>>>
                  >>>>Darren wrote:
                  >>>>
                  >>>>
                  >>>>>Thanks for the reply. Unfortunately I am fairley new to javascript.
                  >>>>>Could you expand on your answer a little. Where exactly would I put
                  >>>>>this code? Thanks!
                  >>>>>
                  >>>>>
                  >>>>>"J Wynia" <jwynia@speakea sy.net> wrote in message
                  >>>>>news:BLidn bx4uO2Mce3fRVn-2w@speakeasy.ne t...
                  >>>>>
                  >>>>>
                  >>>>>
                  >>>>>>I haven't tried it between windows, but theoretically, you could
                  >>>>>>capture the document.body.s crollLeft and document.body.s crollTop (the
                  >>>>>>one you really need) values from the main window, reload and force
                  >>>>>>those values back to what they were before the reload.
                  >>>>>>
                  >>>>>>So:
                  >>>>>>
                  >>>>>>$pageoffs et = document.body.s crollTop;
                  >>>>>>window.op ener.location.r eload();
                  >>>>>>window.op ener.document.b ody.scrollTop = $pageoffset;
                  >>>>>>
                  >>>>>>For your second question, technically the window.onunload event should
                  >>>>>>give you the event handle you need. However, browser implementations
                  >>>>>>and aggressive settings to avoid popunders have rendered this event
                  >>>>>>much less reliable than it might have been in a utopian world where JS
                  >>>>>>wasn't abused for intrusive advertising.
                  >>>>>>
                  >>>>>>-------------------------------------
                  >>>>>>J Wynia
                  >>>>>>Myriad Intellect, Inc.
                  >>>>>>"Web technology that earns its keep."
                  >>>>>>www.myriadintellect.com
                  >>>>>>-------------------------------------
                  >>>>>>
                  >>>>>>Darren wrote:
                  >>>>>>
                  >>>>>>
                  >>>>>>
                  >>>>>>>I have a page that opens a popup window and within the window, some
                  >>>>>>>databs e info is submitted and the window closes. It then refreshes
                  >>>>>>>the original window using window.opener.l ocation.reload( ). The
                  >>>>>>>proble m is that after the reload, it brings you right to the top of
                  >>>>>>>the page. When I click 'refresh" on the original page, it brings me
                  >>>>>>>back to the original viewing position. Is there a way to duplicate
                  >>>>>>>this in from the popup window.
                  >>>>>>>
                  >>>>>>>Also, is there a way to run window.opener.l ocation.reload( ) when the
                  >>>>>>>popup window is closed using the X in the upper right hand corner?
                  >>>>>>>Thanks !
                  >>>>>>>
                  >>>>>>>Darren
                  >>>>>
                  >>>>>[/color][/color]
                  >
                  >[/color]

                  Comment

                  • RobB

                    #10
                    Re: window.opener.l ocation.reload( )

                    Darren wrote:[color=blue]
                    > I changed the third line to window.opener.d ocument.body.sc rollTop =
                    > $pageoffset;
                    >
                    > and this still does not scroll back to the original position. Sorry[/color]
                    for the[color=blue]
                    > trouble!
                    >
                    > Darren[/color]

                    Read *all* responses, please!

                    If you're not going to, kindly make that clear up front
                    so people won't waste their time trying to help you...

                    Rob

                    Comment

                    • Darren

                      #11
                      Re: window.opener.l ocation.reload( )

                      I am sorry, I mis-spoke in my last post. My function looks like this:

                      function close_this_wind ow(){
                      $pageoffset = window.opener.d ocument.body.sc rollTop;
                      window.opener.l ocation.reload( );
                      window.opener.d ocument.body.sc rollTop = $pageoffset;
                      window.close();
                      }

                      This does not work for me!
                      "J Wynia" <jwynia@speakea sy.net> wrote in message
                      news:vcmdnSnMM9 ZJZ-XfRVn-hw@speakeasy.ne t...[color=blue]
                      > You need to change the 1st line, not the 3rd. In general, you're trying to
                      > ask the original page just how far down it's currently scrolled, saving
                      > that number, doing your other stuff, and, when you close your popup window
                      > reload the original page and move it back to where it was. So, you need to
                      > make sure it's fetching the original location before anything else will
                      > work.
                      >
                      > Darren wrote:[color=green]
                      >> I changed the third line to window.opener.d ocument.body.sc rollTop =
                      >> $pageoffset;
                      >>
                      >> and this still does not scroll back to the original position. Sorry for
                      >> the trouble!
                      >>
                      >> Darren
                      >>
                      >> "J Wynia" <jwynia@speakea sy.net> wrote in message
                      >> news:RfudnbQmca fmpu_fRVn-3Q@speakeasy.ne t...
                      >>[color=darkred]
                      >>>Since you said you're learning, I'll try to explain rather than just give
                      >>>you the fix. If it still doesn't make sense, reply and I'll give you the
                      >>>fixed line.
                      >>>
                      >>>There was a bug in the function. If you look at the first line inside the
                      >>>function, and compare the DOM address (the document.body.. . part) to the
                      >>>DOM address in the 3rd line, you should see the problem.
                      >>>
                      >>>The 3rd line is setting the opener document's scroll location. However,
                      >>>the first one isn't getting the scroll location from the opener
                      >>>document's scroll location. Rather it's getting it from the current
                      >>>document, which in this case, is the popup.
                      >>>
                      >>>So, nothing needs to be passed per-se. It's just that the popup is
                      >>>fetching the scroll location from the wrong place (mostly because I
                      >>>wasn't thinking about the 2 window portion when I typed up the line to
                      >>>get the scrolling info.
                      >>>
                      >>>Darren wrote:
                      >>>
                      >>>>I put all this code in the popup window. Everything works except for
                      >>>>the scroll position. Do I need to pass the scroll position from the
                      >>>>parent window to the popup somehow?
                      >>>>
                      >>>>"J Wynia" <jwynia@speakea sy.net> wrote in message
                      >>>>news:wsWdnb tlVqGLhOzfRVn-gg@speakeasy.ne t...
                      >>>>
                      >>>>
                      >>>>>First, put the code for your whole "close this window" process, which
                      >>>>>will give you something like this:
                      >>>>>
                      >>>>>function close_this_wind ow(){
                      >>>>>$pageoffse t = document.body.s crollTop;
                      >>>>>window.ope ner.location.re load();
                      >>>>>window.ope ner.document.bo dy.scrollTop = $pageoffset;
                      >>>>>window.clo se();
                      >>>>>}
                      >>>>>
                      >>>>>That function goes inside a script tag in your <head> tags.
                      >>>>>
                      >>>>>Then, on your <body> tag, you'll attach your function to the "onunload"
                      >>>>>event as well as to the "onclick" event of a button. For the body
                      >>>>>instance of it, the last line of the function is useless, but lets you
                      >>>>>use the same function for manual closing as well as accidental or
                      >>>>>toolbar closing.
                      >>>>>
                      >>>>><body onunload="close _this_window(); ">
                      >>>>>
                      >>>>><button onclick="close_ this_window();" >Close Window</button>
                      >>>>>
                      >>>>>This is all untested, so it may not work perfectly.
                      >>>>>
                      >>>>>-------------------------------------
                      >>>>>J Wynia
                      >>>>>Myriad Intellect, Inc.
                      >>>>>"Web technology that earns its keep."
                      >>>>>www.myriadintellect.com
                      >>>>>-------------------------------------
                      >>>>>
                      >>>>>Darren wrote:
                      >>>>>
                      >>>>>
                      >>>>>>Thanks for the reply. Unfortunately I am fairley new to javascript.
                      >>>>>>Could you expand on your answer a little. Where exactly would I put
                      >>>>>>this code? Thanks!
                      >>>>>>
                      >>>>>>
                      >>>>>>"J Wynia" <jwynia@speakea sy.net> wrote in message
                      >>>>>>news:BLid nbx4uO2Mce3fRVn-2w@speakeasy.ne t...
                      >>>>>>
                      >>>>>>
                      >>>>>>
                      >>>>>>>I haven't tried it between windows, but theoretically, you could
                      >>>>>>>captur e the document.body.s crollLeft and document.body.s crollTop (the
                      >>>>>>>one you really need) values from the main window, reload and force
                      >>>>>>>those values back to what they were before the reload.
                      >>>>>>>
                      >>>>>>>So:
                      >>>>>>>
                      >>>>>>>$pageoff set = document.body.s crollTop;
                      >>>>>>>window.o pener.location. reload();
                      >>>>>>>window.o pener.document. body.scrollTop = $pageoffset;
                      >>>>>>>
                      >>>>>>>For your second question, technically the window.onunload event
                      >>>>>>>should give you the event handle you need. However, browser
                      >>>>>>>implemen tations and aggressive settings to avoid popunders have
                      >>>>>>>render ed this event much less reliable than it might have been in a
                      >>>>>>>utopia n world where JS wasn't abused for intrusive advertising.
                      >>>>>>>
                      >>>>>>>-------------------------------------
                      >>>>>>>J Wynia
                      >>>>>>>Myriad Intellect, Inc.
                      >>>>>>>"Web technology that earns its keep."
                      >>>>>>>www.myriadintellect.com
                      >>>>>>>-------------------------------------
                      >>>>>>>
                      >>>>>>>Darren wrote:
                      >>>>>>>
                      >>>>>>>
                      >>>>>>>
                      >>>>>>>>I have a page that opens a popup window and within the window, some
                      >>>>>>>>datab se info is submitted and the window closes. It then refreshes
                      >>>>>>>>the original window using window.opener.l ocation.reload( ). The
                      >>>>>>>>probl em is that after the reload, it brings you right to the top of
                      >>>>>>>>the page. When I click 'refresh" on the original page, it brings me
                      >>>>>>>>back to the original viewing position. Is there a way to duplicate
                      >>>>>>>>this in from the popup window.
                      >>>>>>>>
                      >>>>>>>>Also, is there a way to run window.opener.l ocation.reload( ) when the
                      >>>>>>>>popup window is closed using the X in the upper right hand corner?
                      >>>>>>>>Thank s!
                      >>>>>>>>
                      >>>>>>>>Darre n
                      >>>>>>
                      >>>>>>[/color]
                      >>[/color][/color]

                      Comment

                      • Darren

                        #12
                        Re: window.opener.l ocation.reload( )

                        I did read your response, but can not get it to work either. You posted the
                        code for three pages, but I only see 2 filenames, so I could not tell which
                        code went with which filename. when the popup posts to the third page I get
                        an http verb error 405!

                        "RobB" <ferndoc9@hotma il.com> wrote in message
                        news:1114794879 .039444.254670@ z14g2000cwz.goo glegroups.com.. .[color=blue]
                        > Darren wrote:[color=green]
                        >> I have a page that opens a popup window and within the window, some[/color]
                        > databse[color=green]
                        >> info is submitted and the window closes. It then refreshes the[/color]
                        > original[color=green]
                        >> window using window.opener.l ocation.reload( ). The problem is that[/color]
                        > after the[color=green]
                        >> reload, it brings you right to the top of the page. When I click[/color]
                        > 'refresh"[color=green]
                        >> on the original page, it brings me back to the original viewing[/color]
                        > position.[color=green]
                        >> Is there a way to duplicate this in from the popup window.
                        >>
                        >> Also, is there a way to run window.opener.l ocation.reload( ) when the[/color]
                        > popup[color=green]
                        >> window is closed using the X in the upper right hand corner? Thanks!
                        >>
                        >> Darren[/color]
                        >
                        > Here are three demo files that offer a possible solution.
                        > Testing is up to you.
                        >
                        > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
                        > "http://www.w3.org/TR/html4/strict.dtd">
                        > <html>
                        > <head>
                        > <style type="text/css">
                        >
                        > body {
                        > font: 120% bold monospace;
                        > }
                        >
                        > </style>
                        > <script type="text/javascript">
                        >
                        > var subwin = null;
                        > function open_subwin()
                        > {
                        > subwin = window.open(
                        > 'subwin.html',
                        > 'subwin',
                        > 'left=200,top=2 00,' +
                        > 'width=240,heig ht=200,' +
                        > 'status,scrollb ars,resizable'
                        > );
                        > if (subwin && !subwin.closed)
                        > subwin.focus();
                        > }
                        >
                        > function saveYpos()
                        > {
                        > var y_scroll =
                        > window.pageYOff set ?
                        > pageYOffset :
                        > document.docume ntElement
                        > && 'undefined' != typeof document.docume ntElement.scrol lTop ?
                        > document.docume ntElement.scrol lTop :
                        > document.body ?
                        > document.body.s crollTop :
                        > null;
                        > if (y_scroll)
                        > window.name = 'YSCROLL@' + y_scroll;
                        > window.location .reload(true);
                        > }
                        >
                        > window.onload = function(m)
                        > {
                        > if (m = window.name.mat ch(/YSCROLL@(\d+)/))
                        > window.scrollTo (0, m[1] || 0);
                        > window.name = '';
                        > }
                        >
                        > </script>
                        > </head>
                        > <body>
                        > <form style="padding: 1200px 0;">
                        > -1<br>-2<br>-3<br>-4<br>-5<br>-6<br>-7<br>-8<br>-9<br><br>
                        > <input
                        > type="button"
                        > value="add data"
                        > onclick="open_s ubwin()">
                        > </form>
                        > </body>
                        > </html>
                        >
                        > [subwin.html]
                        >
                        > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
                        > "http://www.w3.org/TR/html4/strict.dtd">
                        > <html>
                        > <head>
                        > <style type="text/css">
                        >
                        > body {
                        > margin: 50px 10px;
                        > }
                        >
                        > </style>
                        > <script type="text/javascript">
                        >
                        > window.onunload = function()
                        > {
                        > if (opener
                        > && !opener.closed
                        > && opener.saveYpos )
                        > {
                        > opener.saveYpos ();
                        > }
                        > }
                        >
                        > </script>
                        > </head>
                        > <body>
                        > <form
                        > action="f_actio n.html"
                        > method="post"
                        > onsubmit="windo w.onunload=null ">
                        > <input
                        > type="text"
                        > name="newdata"
                        > value="new data">
                        > <input
                        > type="submit"
                        > value="done">
                        > </form>
                        > </body>
                        > </html>
                        >
                        > [f_action.html]
                        >
                        > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
                        > "http://www.w3.org/TR/html4/strict.dtd">
                        > <html>
                        > <head>
                        > <script type="text/javascript">
                        >
                        > if (opener
                        > && !opener.closed
                        > && opener.saveYpos )
                        > {
                        > opener.saveYpos ();
                        > }
                        > self.close();
                        >
                        > </script>
                        > </head>
                        > <body>
                        > </body>
                        > </html>
                        >[/color]


                        Comment

                        • RobB

                          #13
                          Re: window.opener.l ocation.reload( )

                          Darren wrote:[color=blue]
                          > I did read your response, but can not get it to work either. You[/color]
                          posted the[color=blue]
                          > code for three pages, but I only see 2 filenames [..][/color]

                          That's because two of the files are referenced in two other files, and
                          one is the 'main' page. Just launch it.
                          [color=blue]
                          > so I could not tell which
                          > code went with which filename. [..][/color]

                          The one above it. I mean, seriously...
                          [color=blue]
                          > when the popup posts to the third page I get
                          > an http verb error 405![/color]

                          (snip)

                          Not up on verb errors. Just paste all three files into a local
                          directory, naming two with the name >above< them, and run the other.
                          Does it scroll?

                          Comment

                          • J Wynia

                            #14
                            Re: window.opener.l ocation.reload( )

                            Then you need to look elsewhere in your code, because in less than 2
                            minutes I whipped up 2 sample files and used the function you most
                            recently posted and it works fine. I just copied and pasted directly
                            from your most recent post and it works. I put this function in a test
                            file name parent.html along with a bunch of garbage and <br> tags above
                            it to ensure that I had to scroll to get to the link:

                            <a href="#" onclick="myWind ow = window.open('po pup.html', 'windowname',
                            'toolbar,width= 150,height=100' ); return false;">Functio n Test</a>

                            Then, I put your function into the header of another file called
                            popup.html, added some window.alert's to see exactly what's going on and
                            another link in that one like this:

                            <a href="#" onclick="close_ this_window();r eturn false;">Functio n Test</a>

                            I then opened parent.html, scrolled down to the link and clicked. The
                            new window popped up with the other link in it. I clicked that link and
                            got 3 popups with the appropriate values in them: 1184, 0, 1184. The
                            parent page moved up and back down as well as reloading.

                            In short, the code works.

                            Darren wrote:[color=blue]
                            > I am sorry, I mis-spoke in my last post. My function looks like this:
                            >
                            > function close_this_wind ow(){
                            > $pageoffset = window.opener.d ocument.body.sc rollTop;
                            > window.opener.l ocation.reload( );
                            > window.opener.d ocument.body.sc rollTop = $pageoffset;
                            > window.close();
                            > }
                            >
                            > This does not work for me!
                            > "J Wynia" <jwynia@speakea sy.net> wrote in message
                            > news:vcmdnSnMM9 ZJZ-XfRVn-hw@speakeasy.ne t...
                            >[color=green]
                            >>You need to change the 1st line, not the 3rd. In general, you're trying to
                            >>ask the original page just how far down it's currently scrolled, saving
                            >>that number, doing your other stuff, and, when you close your popup window
                            >>reload the original page and move it back to where it was. So, you need to
                            >>make sure it's fetching the original location before anything else will
                            >>work.
                            >>
                            >>Darren wrote:
                            >>[color=darkred]
                            >>>I changed the third line to window.opener.d ocument.body.sc rollTop =
                            >>>$pageoffse t;
                            >>>
                            >>>and this still does not scroll back to the original position. Sorry for
                            >>>the trouble!
                            >>>
                            >>>Darren
                            >>>
                            >>>"J Wynia" <jwynia@speakea sy.net> wrote in message
                            >>>news:RfudnbQ mcafmpu_fRVn-3Q@speakeasy.ne t...
                            >>>
                            >>>
                            >>>>Since you said you're learning, I'll try to explain rather than just give
                            >>>>you the fix. If it still doesn't make sense, reply and I'll give you the
                            >>>>fixed line.
                            >>>>
                            >>>>There was a bug in the function. If you look at the first line inside the
                            >>>>function, and compare the DOM address (the document.body.. . part) to the
                            >>>>DOM address in the 3rd line, you should see the problem.
                            >>>>
                            >>>>The 3rd line is setting the opener document's scroll location. However,
                            >>>>the first one isn't getting the scroll location from the opener
                            >>>>document' s scroll location. Rather it's getting it from the current
                            >>>>document, which in this case, is the popup.
                            >>>>
                            >>>>So, nothing needs to be passed per-se. It's just that the popup is
                            >>>>fetching the scroll location from the wrong place (mostly because I
                            >>>>wasn't thinking about the 2 window portion when I typed up the line to
                            >>>>get the scrolling info.
                            >>>>
                            >>>>Darren wrote:
                            >>>>
                            >>>>
                            >>>>>I put all this code in the popup window. Everything works except for
                            >>>>>the scroll position. Do I need to pass the scroll position from the
                            >>>>>parent window to the popup somehow?
                            >>>>>
                            >>>>>"J Wynia" <jwynia@speakea sy.net> wrote in message
                            >>>>>news:wsWdn btlVqGLhOzfRVn-gg@speakeasy.ne t...
                            >>>>>
                            >>>>>
                            >>>>>
                            >>>>>>First, put the code for your whole "close this window" process, which
                            >>>>>>will give you something like this:
                            >>>>>>
                            >>>>>>functio n close_this_wind ow(){
                            >>>>>>$pageoffs et = document.body.s crollTop;
                            >>>>>>window.op ener.location.r eload();
                            >>>>>>window.op ener.document.b ody.scrollTop = $pageoffset;
                            >>>>>>window.cl ose();
                            >>>>>>}
                            >>>>>>
                            >>>>>>That function goes inside a script tag in your <head> tags.
                            >>>>>>
                            >>>>>>Then, on your <body> tag, you'll attach your function to the "onunload"
                            >>>>>>event as well as to the "onclick" event of a button. For the body
                            >>>>>>instanc e of it, the last line of the function is useless, but lets you
                            >>>>>>use the same function for manual closing as well as accidental or
                            >>>>>>toolbar closing.
                            >>>>>>
                            >>>>>><body onunload="close _this_window(); ">
                            >>>>>>
                            >>>>>><button onclick="close_ this_window();" >Close Window</button>
                            >>>>>>
                            >>>>>>This is all untested, so it may not work perfectly.
                            >>>>>>
                            >>>>>>-------------------------------------
                            >>>>>>J Wynia
                            >>>>>>Myriad Intellect, Inc.
                            >>>>>>"Web technology that earns its keep."
                            >>>>>>www.myriadintellect.com
                            >>>>>>-------------------------------------
                            >>>>>>
                            >>>>>>Darren wrote:
                            >>>>>>
                            >>>>>>
                            >>>>>>
                            >>>>>>>Thanks for the reply. Unfortunately I am fairley new to javascript.
                            >>>>>>>Could you expand on your answer a little. Where exactly would I put
                            >>>>>>>this code? Thanks!
                            >>>>>>>
                            >>>>>>>
                            >>>>>>>"J Wynia" <jwynia@speakea sy.net> wrote in message
                            >>>>>>>news:BLi dnbx4uO2Mce3fRV n-2w@speakeasy.ne t...
                            >>>>>>>
                            >>>>>>>
                            >>>>>>>
                            >>>>>>>
                            >>>>>>>>I haven't tried it between windows, but theoretically, you could
                            >>>>>>>>captu re the document.body.s crollLeft and document.body.s crollTop (the
                            >>>>>>>>one you really need) values from the main window, reload and force
                            >>>>>>>>those values back to what they were before the reload.
                            >>>>>>>>
                            >>>>>>>>So:
                            >>>>>>>>
                            >>>>>>>>$pageof fset = document.body.s crollTop;
                            >>>>>>>>window. opener.location .reload();
                            >>>>>>>>window. opener.document .body.scrollTop = $pageoffset;
                            >>>>>>>>
                            >>>>>>>>For your second question, technically the window.onunload event
                            >>>>>>>>shoul d give you the event handle you need. However, browser
                            >>>>>>>>impleme ntations and aggressive settings to avoid popunders have
                            >>>>>>>>rendere d this event much less reliable than it might have been in a
                            >>>>>>>>utopi an world where JS wasn't abused for intrusive advertising.
                            >>>>>>>>
                            >>>>>>>>-------------------------------------
                            >>>>>>>>J Wynia
                            >>>>>>>>Myria d Intellect, Inc.
                            >>>>>>>>"Web technology that earns its keep."
                            >>>>>>>>www.myriadintellect.com
                            >>>>>>>>-------------------------------------
                            >>>>>>>>
                            >>>>>>>>Darre n wrote:
                            >>>>>>>>
                            >>>>>>>>
                            >>>>>>>>
                            >>>>>>>>
                            >>>>>>>>>I have a page that opens a popup window and within the window, some
                            >>>>>>>>>databs e info is submitted and the window closes. It then refreshes
                            >>>>>>>>>the original window using window.opener.l ocation.reload( ). The
                            >>>>>>>>>proble m is that after the reload, it brings you right to the top of
                            >>>>>>>>>the page. When I click 'refresh" on the original page, it brings me
                            >>>>>>>>>back to the original viewing position. Is there a way to duplicate
                            >>>>>>>>>this in from the popup window.
                            >>>>>>>>>
                            >>>>>>>>>Also , is there a way to run window.opener.l ocation.reload( ) when the
                            >>>>>>>>>popu p window is closed using the X in the upper right hand corner?
                            >>>>>>>>>Thanks !
                            >>>>>>>>>
                            >>>>>>>>>Darr en
                            >>>>>>>
                            >>>>>>>[/color][/color]
                            >[/color]

                            Comment

                            • Dr John Stockton

                              #15
                              Re: window.opener.l ocation.reload( )

                              JRS: In article <68bb0$4278fd13 $d8cc6cea$24398 @LIGHTSHIP.NET> , dated
                              Wed, 4 May 2005 12:50:41, seen in news:comp.lang. javascript, Darren
                              <news@lan-specialist.com> posted :
                              [color=blue]
                              >Lines: 148[/color]

                              [color=blue]
                              >I am sorry, I mis-spoke in my last post. My function looks like this:
                              >
                              >function close_this_wind ow(){
                              >$pageoffset = window.opener.d ocument.body.sc rollTop;
                              >window.opener. location.reload ();
                              >window.opener. document.body.s crollTop = $pageoffset;
                              >window.close() ;
                              >}
                              >
                              >This does not work for me!
                              >"J Wynia" <jwynia@speakea sy.net> wrote in message
                              >news:vcmdnSnMM 9ZJZ-XfRVn-hw@speakeasy.ne t...[color=green]
                              >> You need to change the 1st line, not the 3rd. In general, you're trying to
                              >> ask the original page[/color][/color]

                              Note that when you top-post and overquote, regular experts are less
                              likely to bother to reply to your problem.

                              Likewise, they are less likely to bother to check J Wynia's replies.
                              Since he is of Myriad Intellect, he ought to be able to get things
                              right, even though he has no Organization:. As, indeed, should a lan-
                              specialist.

                              See Wednesday posting of newsgroup FAQ.

                              --
                              © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 MIME ©
                              Web <URL:http://www.uwasa.fi/~ts/http/tsfaq.html> -> Timo Salmi: Usenet Q&A.
                              Web <URL:http://www.merlyn.demo n.co.uk/news-use.htm> : about usage of News.
                              No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.

                              Comment

                              Working...