Skip to main content

Bug Tracker

Side navigation

#6369 closed bug ()

Opened March 28, 2010 09:28PM UTC

Closed November 11, 2010 11:09PM UTC

Last modified March 15, 2012 01:18PM UTC

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

Reported by: mcslayton@comcast.ne Owned by: mcslayton@comcast.ne
Priority: low Milestone: 1.5
Component: event Version: 1.4.2
Keywords: Cc:
Blocked by: Blocking:
Description

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;

};

Attachments (0)
Change History (5)

Changed April 05, 2010 09:12PM UTC by scalvert comment:1

I'm seeing the same error.

Changed June 15, 2010 01:07AM UTC by dmethvin comment:2

component: unfiledevent

Changed September 10, 2010 09:01PM UTC by bbostow comment:3

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.

Changed October 23, 2010 09:32PM UTC by SlexAxton comment:4

milestone: 1.4.31.5
owner: → mcslayton@comcast.ne
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?

Changed November 11, 2010 11:09PM UTC by trac-o-bot comment:5

status: pendingclosed

Automatically closed due to 14 days of inactivity.