Advertisement

09.28.2005 at 09:11AM PDT, ID: 21577203
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

4.6

How to register an event in an opened window?

Asked by RoboRubik in JavaScript

Tags:

I am trying to open a window, store a reference to it in a var and then make sure the window closes if the opening window closes, also if the button to open the window is clicked while the window is opened (and maybe behind the opening window) it will refresh the page and focus the window to pop it to the top.  For now it only needs to work in IE 5.5+

I want to keep all of the script for this in one block for future encapsulation into an aspx control, so it must not rely on script inside the opened window.  All of this works except for one hitch.  The line that registers the onBeforeUnload event seems to work in the sense that if I do an alert(exportWindow.onBeforeUnload) it will show me the registered function, but the function does not actually execute.  I have experimented with registering different events in the opened window from the opener, but they never fire.  What's the problem?

Here's the code:

var exportWindow;
function openMapExportWindow() {
      if (exportWindow) {
            exportWindow.location = 'Export.aspx';
            exportWindow.focus();
            alert(exportWindow);
      } else {
            var winX = window.screenTop;
            var winY = window.screenLeft;
            var top =  winX;
            var left = winY;
            windowProperties = "width=400,height=400,top=" + top + ",left=" + left + ",resizable=yes,scrollbars=auto";
            exportWindow = window.open("Export.aspx", "ExportWindow", windowProperties);

                                // This seems to register, but does not execute!?
            exportWindow.onBeforeUnload = function() {opener.exportWindow = null;};

            exportWindow.focus();
            event.cancelBubble = true;  // prevent the toolbar from posting back to execute server side function
      }
}

closeExportWindow() {
            if(exportWindow) exportWindow.close;
}

addUnloadEvent (closeMapExportWindow);

function addUnloadEvent(functionName) {
      var oldonunload = window.onunload;
      if (typeof window.onUnload != 'function') {
            window.onUnload = functionName;
      } else {
            window.onUnload = function() {
                  oldonunload();
                  functionName();
            }
      }
}

Start Free Trial
 
Loading Advertisement...
 
[+][-]09.28.2005 at 10:14AM PDT, ID: 14976901

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.28.2005 at 10:38AM PDT, ID: 14977114

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.28.2005 at 11:16AM PDT, ID: 14977479

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.28.2005 at 11:17AM PDT, ID: 14977495

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.28.2005 at 11:18AM PDT, ID: 14977508

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.28.2005 at 11:23AM PDT, ID: 14977570

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.28.2005 at 11:54AM PDT, ID: 14977859

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.28.2005 at 12:09PM PDT, ID: 14978022

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.28.2005 at 12:20PM PDT, ID: 14978145

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.28.2005 at 01:21PM PDT, ID: 14978782

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.28.2005 at 01:23PM PDT, ID: 14978806

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.28.2005 at 01:45PM PDT, ID: 14979010

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.28.2005 at 01:48PM PDT, ID: 14979028

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.28.2005 at 01:52PM PDT, ID: 14979070

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.28.2005 at 01:54PM PDT, ID: 14979081

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: JavaScript
Tags: addunloadevent
Sign Up Now!
Solution Provided By: Palamedes
Participating Experts: 2
Solution Grade: C
 
 
[+][-]09.28.2005 at 01:59PM PDT, ID: 14979127

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.28.2005 at 02:38PM PDT, ID: 14979398

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32