SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Sep 2000
    Location
    Ontario, Canada
    Posts
    320
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    focusing pre-existing window

    I'm having some window focusing problems... here's the steps that I've taken:

    I am opening a "contact window" from the parent -

    Code:
    function openFeedbackWindow(thePage) {
       feedbackWin=window.open(thePage,'feedback',settings)
    }
    From that window, the opened file checks to see if the user has entered a contact signature. If not, user clicks link in child window to open signature editor in parent -

    Code:
    function openparent(url) {
       opener.location.href = url;
    }
    Once the user submits new signature in parent, "feedbackWin" is supposed to focus -

    Code:
    var feedbackWin;
    if (feedbackWin) {
       feedbackWin.focus();
    }
    else {
       feedbackWin = window.open('/<?=$url;?>','feedback', settings);
    }
    So that is how I'd like it to be working however instead of feedbackWin focusing the old window with existing contents, the old window is focused and reloaded. So somehow, the feedbackWin variable is being lost in the process.

    Does my description make any sense?? It seems like there is just a communication issue between parent and child windows.

    Any suggestions for getting around this problem are greatly appreciated!!
    Jason Dulberg
    Extreme MTB
    http://extreme.nas.net

  2. #2
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    var feedbackWin;
    
    if ( typeof feedbackWin == 'object' ) {
       feedbackWin.focus();
    }
    else {
       feedbackWin = window.open('/<?=$url;?>','feedback', settings);
    }
    see http://www.webmasterbase.com/article/473/60

  3. #3
    SitePoint Addict
    Join Date
    Sep 2000
    Location
    Ontario, Canada
    Posts
    320
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the code and the link Freakysid...

    I tried your code however the problem remains. The old window is being focused with reloaded contents instead of focusing the existing contents.

    Just to clarify the location of the code that you supplied is contained within the file in the child window.

    Thank you for the link to the tutorial. I will definitely return to it in the morning
    Jason Dulberg
    Extreme MTB
    http://extreme.nas.net


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
  •