SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Addict mcrumlish's Avatar
    Join Date
    Jan 2002
    Posts
    384
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    error reloading page

    Hi,

    I have a window that generates a popup. In the popup a link takes you to a second page within the popup.In the 2nd page of the popup I have the following code

    Code:
    <body onUnload="opener.location.replace(window.opener.location);">
    This reloads the original parent window. This reloads the page but is causing the problems, the page seems to change but it is going to this URL

    http://www.mysitehere.com/[object]

    It should refresh the page but instead it is adding the [object] piece to the end.

    Do you have any idea's on how to fix this (or an alternative)?

    Thanks in advance,

    Martin

  2. #2
    You talkin to me? Anarchos's Avatar
    Join Date
    Oct 2000
    Location
    Austin, TX
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That should be "window.opener.location.href" instead of "window.opener.location"; alernatively you can just do opener.location.reload()
    ck :: bringing chris to the masses.

  3. #3
    SitePoint Addict mcrumlish's Avatar
    Join Date
    Jan 2002
    Posts
    384
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I was trying opener.location.reload() but it doesnt seem to work.

    Here is how my script is set up.

    In page 1 I have the popup code:

    Code:
    function go_login () {
       loginslip=window.open("","loginslip","width=300,height=275,resizable");
       loginslip.focus();	
       document.fmLogin.submit();
       document.fmLogin.reset();
    }
    You will notice in the code above that no URL is being passed to the function to load a page in the window. What the code does when called is create a popup window and then submits the form. The form has a target of "loginslip" (the name of the new window). It goes to some server side code (done in TCL) and if your login is a success it loads login_success.html in the loginslip window and if its a failure it laods login_fail.html in the window.

    The reson I think the opener.location.reload() isn't working is because the window actually erxists and then another page is loaded.

    ie: I fill my login details and hit submit, the popup is created and the form submits. My login is a success and login_success.html is loaded. Therefore, the original parent window isn't actually the opener of login_success.html.

    Is there some way i can name the parent window with self.name or something and then reload it from the login_success.html page?


Bookmarks

Posting Permissions

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