By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,377 Members | 1,657 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,377 IT Pros & Developers. It's quick & easy.

FireBug: How do you tell which browser window an exeption occurred in

Frinavale
Expert Mod 5K+
P: 9,731
I'm having a problem that I cannot seem to debug.

FireFox's FireBug extension is indicating that there is an error being thrown, but I have no idea which window caused the error to be thrown.

I have 3 browser windows open:
  • (parent) the main window that is displaying a page where the user can provide details in order to create a new thing,
  • (first child) a child window of the main window that is displaying page that describes details about a particular property of the thing & allows the user to edit this
  • (second child) a child window of the first child window that is displaying details about a particular thing in in the first child window.

So, when the user closes the second child window, the first child window needs to update in order to display current information.

In order to do this I'm calling a function in the first child window during the onbeforeunload event in the second child window:

(First Child Window)
Expand|Select|Wrap|Line Numbers
  1. function UpdateDetails() {
  2.    //do stuff that
  3. }
(Second Child Window)
Expand|Select|Wrap|Line Numbers
  1.  window.onbeforeunload = CloseEvent;
  2.  
  3. function CloseEvent() {
  4.    if (window.opener && !window.opener.closed) {
  5.       window.opener.UpdateDetails();
  6.     }
  7. }
  8. function CloseBrowserWindow() {
  9.    window.close();
  10. }
Simple right?
Well an exception's being thrown Somewhere along the line.
The exception is as follows:

Sys is not defined
Sys$CultureInfo$_getAbbrMonthIndex("")ScriptRe...= 2bdecd23 (line 6391)
ScriptResource.axd?d=J5i-KabhFu-XHqJ2IolaVHA6NLOVUeCKfCK59WFRjeQwUmCK8H7qKbDJpNBkR gMbkm7VMmvHbbz8H3ZZJBf4uQ2&t=ffffffffaf03ec7a()()
This exception is being thrown by a function in the the ASP.NET Ajax framework/class library....

One annoying thing about this exception is that my code has nothing to do with the "getAbbrMontIndex" method and I have no idea why it's being called.

The other thing that is really confusing to me is which window is the exception being thrown in?

Is it being thrown in the second child window when it's closed?
Is it thrown in the first child window?

How can I tell?
Mar 12 '09 #1
Share this Question
Share on Google+
1 Reply


Frinavale
Expert Mod 5K+
P: 9,731
I don't know the answer to my question regarding FireBug (how to determine which browser window an exception occurred in).

But I solved my problem regarding the exception.

I figured that since the exception was being thrown because Ajax Framework was unavailable it had to do with the second child window being closed.

As it turned out the "exit" button on the page being displayed in the second child window (it closed the browser window) was submitting to the server. When the response came back, the window was closed (or more likely in the process of closing) and so the exception was thrown.

After adding code that prevented the button from submitting to the server the exception no longer occurred.

I still don't know how to tell which browser window an exception is thrown in using FireBug and would love to learn the answer to this if anyone has it.

Thanks

-Frinny
Mar 12 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.