?
Solved

Background Window dissappearing

Posted on 2011-10-23
5
Medium Priority
?
143 Views
Last Modified: 2012-07-24
Hello,

I am working on some javascript code for a help button that open a help popup window.
Sample code as follows:

var HelpWindow = window.open( ...);
window.focus(this)

This code opens a Help popup window in the foreground when the Help button from the parent window is pressed. The problem that I have, is when I close the Help popup Window, the parent Window dissapears. I have to click on the screen with the mouse pointer and the background Window re-appears.

I have been reading that I might need to add some kind of recursive timer to check if the Help popup window is Closed HelpWindow.closed or something to reset the focus(). Or maybe reset the focus like

opener.focus(this);

Not sure how to resolve this issue ?
Has anyone ran into this problem ?
Suggestions ?

Paolo
0
Comment
Question by:ptreves
  • 4
5 Comments
 
LVL 4

Expert Comment

by:CKY092
ID: 37015328
Do you have a link to the site? Or some sample code?
0
 

Author Comment

by:ptreves
ID: 37017365
Here is the javascript function:

/**
 * Shows the current {@link #helpUrl} in a new window.
 */
function showHelp() {
    var fullHelpURL = "$helpDirectory" + helpUrl;

    helpWindow = window.open(fullHelpURL, 'Help', 'width=650,height=500,
                                                   toolbar=no,resizable=yes,scrollbars=yes');
    helpWindow.focus(this);
    var timer = setInterval(function() {    
       if(helpWindow.closed) {  
         clearInterval(timer);
         helpWindow.blur();
         helpWindow.back();
         opener.focus(this);  
       }  
    }, 200);
}

In the timer loop, I am thicking of either one of the following statements:
         helpWindow.blur();
         helpWindow.back();
         opener.focus(this);  

Suggestions?

Paolo
0
 

Accepted Solution

by:
ptreves earned 0 total points
ID: 37019829
How can I reset the focus to the parent Window when I close the popup ?
0
 

Author Comment

by:ptreves
ID: 37050867
Can you show me some sample code to do that ?

Paolo
0
 

Author Closing Comment

by:ptreves
ID: 38217617
solved problem
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question