Bug Tracker

Opened 13 years ago

Closed 12 years ago

Last modified 11 years ago

#6369 closed bug

In IE v8.0.7600.16385 Line 1919 v1.4.2 undefined when exiting page???

Reported by: [email protected] Owned by: [email protected]
Priority: low Milestone: 1.5
Component: event Version: 1.4.2
Keywords: Cc:
Blocked by: Blocking:


Strange behavior / error. When using IE v8 I could run my full, very heavy jQuery v1.4.2 w/ v1.8 jQuery UI app with all functions without error UNTIL I tried to navigate away from the page and then line 1919 below would get an undefined error. What's bizarre is I have NOT onbeforeunload kind of logic in the app?????

I had to wrap the setting of this line:

var events = jQuery.data(this, "events"), handlers = events[event.type];

Like this:

try {

events = jQuery.data(this, "events"), handlers = events[event.type];

} catch (err) {

events = null;


Change History (5)

comment:1 Changed 13 years ago by scalvert

I'm seeing the same error.

comment:2 Changed 13 years ago by dmethvin

Component: unfiledevent

comment:3 Changed 13 years ago by bbostow

This can happen after the unload event is fired. Using the try catch code that is in the bug will still generate an exception because of the if( event && handler). I was able to mitigate this and also handle the case reported in bug #6163 by changing lines 1919 through 1921 to use the following:

  events = jQuery.data(this, "events");
  handlers = (typeof(events) !== "undefined" && events !== null)? events[ event.type ] : null;

  if ( handlers ) {

using null as the default for handlers was to preserve the if(events && handlers) logic. If handlers or events is undefined the if statement may throw an undefined error. The other option is to change jQuery.data so that it returns an object that is not undefined or null but still preserves the need of the if statement.

comment:4 Changed 12 years ago by SlexAxton

Owner: set to [email protected]
Priority: low
Status: newpending

It'd be great to have a test-case page that we could use to fix this bug. Anyone that has been able to duplicate willing to make a jsfiddle/jsbin page for us?

comment:5 Changed 12 years ago by trac-o-bot

Status: pendingclosed

Automatically closed due to 14 days of inactivity.

Note: See TracTickets for help on using tickets.