Back (history.back()) after refresh

Discussion in 'Javascript' started by Bruno, May 29, 2006.

  1. Bruno

    Bruno Guest

    Hi ...

    I have a webpage popup (lets call it POPUP) which refreshes the opener
    window (this one we call PARENT) when we close it, saying we want to
    save data.

    For this, we use

    top.oWndOpener.refresh();

    When we don't want to save the POPUP data, we just close the popup and
    don't refresh the PARENT.

    In the PARENT we have a "Back" link which executes a simple

    history.back()

    The problem is:
    If we refresh parent, we need to go back 2 pages, because the refresh
    method adds another page to the history. But we have no (easy) way of
    knowing in the PARENT if it had been refreshed. With this, our users
    are forced to click two times in the Back link.

    Is there anyway of going back to the previous page, no matter how many
    refreshes happened in the current one ?

    Thanks!!!!!
    Bruno
    Bruno, May 29, 2006
    #1
    1. Advertising

  2. Bruno

    Randy Webb Guest

    Bruno said the following on 5/29/2006 6:45 AM:
    > Hi ...
    >
    > I have a webpage popup (lets call it POPUP) which refreshes the opener
    > window (this one we call PARENT) when we close it, saying we want to
    > save data.


    My apologies for you being stuck in 1999 with the use of popups.

    > For this, we use
    >
    > top.oWndOpener.refresh();
    >
    > When we don't want to save the POPUP data, we just close the popup and
    > don't refresh the PARENT.
    >
    > In the PARENT we have a "Back" link which executes a simple
    >
    > history.back()
    > The problem is:
    > If we refresh parent, we need to go back 2 pages, because the refresh
    > method adds another page to the history. But we have no (easy) way of
    > knowing in the PARENT if it had been refreshed. With this, our users
    > are forced to click two times in the Back link.
    >
    > Is there anyway of going back to the previous page, no matter how many
    > refreshes happened in the current one ?


    Yeah, don't use refresh, use either reload or replace.

    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
    Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
    Randy Webb, May 29, 2006
    #2
    1. Advertising

  3. Bruno

    Bruno Lopes Guest

    Thanks Randy. Resolved.
    Bruno Lopes
    Bruno Lopes, May 30, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sam Stephenson
    Replies:
    1
    Views:
    223
    Andrew Walrond
    Jun 18, 2005
  2. mickey
    Replies:
    1
    Views:
    94
  3. Replies:
    4
    Views:
    115
  4. Replies:
    2
    Views:
    289
    nutso fasst
    Oct 17, 2006
  5. Niall
    Replies:
    3
    Views:
    163
    Niall
    Dec 6, 2006
Loading...

Share This Page