Refresh parent window with querystring or replace it?

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

    Refresh parent window with querystring or replace it?

    Hi there, I'm not very good at javascript but I'm using the following
    to close a child window and refresh a parent window after updating a
    database. It's within an ASP page.

    CODE
    <SCRIPT>
    function CloseWindow() {
    if (window.opener && !window.opener. closed) {
    window.opener.d ocument.locatio n.reload();
    window.close();
    }
    }
    </SCRIPT>

    When my parent window reloads, is there any way to include a
    querystring, or replace the parent with another URL? It needs to
    reload, but it needs to jump to a particular anchor on the page. I do
    not want to use session variables. Any way to modify the above code
    to accomplish this? Thanks.
  • Randy Webb

    #2
    Re: Refresh parent window with querystring or replace it?

    Debbie Davis wrote:
    [color=blue]
    > Hi there, I'm not very good at javascript but I'm using the following
    > to close a child window and refresh a parent window after updating a
    > database. It's within an ASP page.
    >
    > CODE
    > <SCRIPT>
    > function CloseWindow() {
    > if (window.opener && !window.opener. closed) {
    > window.opener.d ocument.locatio n.reload();
    > window.close();
    > }
    > }
    > </SCRIPT>
    >
    > When my parent window reloads, is there any way to include a
    > querystring, or replace the parent with another URL? It needs to
    > reload, but it needs to jump to a particular anchor on the page. I do
    > not want to use session variables. Any way to modify the above code
    > to accomplish this? Thanks.[/color]

    window.opener.l ocation.href=wi ndow.opener.loc ation.href + "#anchorNam e";

    instead of reload(). Might be better to use
    window.opener.l ocation.replace () instead, so that the history trail
    doesn't get too cluttered.


    edit the anchorName as you need.

    --
    Randy
    Chance Favors The Prepared Mind
    comp.lang.javas cript FAQ - http://jibbering.com/faq/

    Comment

    Working...