#1
  1. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    28
    Rep Power
    0

    JAVASCRIPT: Changing parent status on child unload


    I've searched for a method of doing this, maybe someone can enlighten me. I'm somewhat new to JS and am using a popup window to show some details on the parent, works fine as is. Something like this:

    <a href="javascript:void window.open('../details.php?row_id=".$row_id."','detailsWin','width=400,height=425,left=300,top=100')";>Details...</a>

    (this is nested within a PHP script)

    What I'm having problems with is the fact that when the user closes the child window, the above shown JS is stuck in the status window until the user moves over another link on the page. Looks tacky.

    The solution I thought of would be to use the onUnload handler on the child window to change the status of the parent window to nothing when it's closed, but I can't find any specific reference on how to do this. Ideas? Would specifically changing the focus of the window back to the parent help?
  2. #2
  3. mod_dev_shed
    Devshed Supreme Being (6500+ posts)

    Join Date
    Sep 2002
    Location
    Atlanta, GA
    Posts
    14,817
    Rep Power
    1099
    Code:
    <body onunload="window.opener.status='';return true">
  4. #3
  5. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    28
    Rep Power
    0
    Thanks for the reply; works perfectly!

IMN logo majestic logo threadwatch logo seochat tools logo